java.lang.Object
one.jpro.platform.auth.routing.UserSession
The
UserSession class provides a structured way to handle user authentication and maintain inside the session.-
Constructor Summary
ConstructorsConstructorDescriptionUserSession(javafx.collections.ObservableMap<String, String> session) Creates a new instance of the UserAPI class. -
Method Summary
Modifier and TypeMethodDescriptionfinal one.jpro.platform.auth.core.authentication.UsergetUser()Retrieves the user object from the session.final booleanChecks if the user is logged in.final voidlogout()Removes the user object from the session.final voidsetUser(one.jpro.platform.auth.core.authentication.User user) Sets the user object in the session.
-
Constructor Details
-
UserSession
Creates a new instance of the UserAPI class.- Parameters:
session- the session to use for session management
-
-
Method Details
-
getUser
public final one.jpro.platform.auth.core.authentication.User getUser()Retrieves the user object from the session.- Returns:
- the user object retrieved from the session
-
setUser
public final void setUser(one.jpro.platform.auth.core.authentication.User user) Sets the user object in the session.- Parameters:
user- the user object to set in the session
-
logout
public final void logout()Removes the user object from the session. -
isLoggedIn
public final boolean isLoggedIn()Checks if the user is logged in.- Returns:
- true if the user is logged in, false otherwise
-