java.lang.Object
one.jpro.platform.auth.routing.UserSession

public class UserSession extends Object
The UserSession class provides a structured way to handle user authentication and maintain inside the session.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserSession(javafx.collections.ObservableMap<String,String> session)
    Creates a new instance of the UserAPI class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final one.jpro.platform.auth.core.authentication.User
    Retrieves the user object from the session.
    final boolean
    Checks if the user is logged in.
    final void
    Removes the user object from the session.
    final void
    setUser(one.jpro.platform.auth.core.authentication.User user)
    Sets the user object in the session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UserSession

      public UserSession(javafx.collections.ObservableMap<String,String> session)
      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