Class UserEmailAuthToken

java.lang.Object
org.localify.user.support.UserEmailAuthToken

@Entity public class UserEmailAuthToken extends Object
Represents a token used to authenticate a user via email.
  • Constructor Details

    • UserEmailAuthToken

      public UserEmailAuthToken()
      Default constructor.
    • UserEmailAuthToken

      public UserEmailAuthToken(UUID sessionId, User user, String authToken, Instant expiresAt)
      Creates a new user email authentication token.
      Parameters:
      sessionId - The session ID.
      user - The user.
      authToken - The authentication token.
      expiresAt - The expiration timestamp.
  • Method Details

    • isExpired

      public boolean isExpired()
      Checks if the token has expired.
      Returns:
      true if the token has expired, false otherwise.
    • getId

      public UUID getId()
      Gets the ID of the token.
      Returns:
      The ID.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp of the token.
      Returns:
      The creation timestamp.
    • getExpiresAt

      public Instant getExpiresAt()
      Gets the expiration timestamp of the token.
      Returns:
      The expiration timestamp.
    • getUser

      public User getUser()
      Gets the user associated with the token.
      Returns:
      The user.
    • getAuthToken

      public String getAuthToken()
      Gets the authentication token.
      Returns:
      The authentication token.
    • setExpiresAt

      public void setExpiresAt(Instant expiresAt)
      Sets the expiration timestamp of the token.
      Parameters:
      expiresAt - The expiration timestamp.
    • setUser

      public void setUser(User user)
      Sets the user associated with the token.
      Parameters:
      user - The user.
    • setAuthToken

      public void setAuthToken(String authToken)
      Sets the authentication token.
      Parameters:
      authToken - The authentication token.