Package org.localify.user.support
Class UserEmailAuthToken
java.lang.Object
org.localify.user.support.UserEmailAuthToken
Represents a token used to authenticate a user via email.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.UserEmailAuthToken(UUID sessionId, User user, String authToken, Instant expiresAt) Creates a new user email authentication token. -
Method Summary
Modifier and TypeMethodDescriptionGets the authentication token.Gets the creation timestamp of the token.Gets the expiration timestamp of the token.getId()Gets the ID of the token.getUser()Gets the user associated with the token.booleanChecks if the token has expired.voidsetAuthToken(String authToken) Sets the authentication token.voidsetExpiresAt(Instant expiresAt) Sets the expiration timestamp of the token.voidSets the user associated with the token.
-
Constructor Details
-
UserEmailAuthToken
public UserEmailAuthToken()Default constructor. -
UserEmailAuthToken
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
Gets the ID of the token.- Returns:
- The ID.
-
getCreatedAt
Gets the creation timestamp of the token.- Returns:
- The creation timestamp.
-
getExpiresAt
Gets the expiration timestamp of the token.- Returns:
- The expiration timestamp.
-
getUser
Gets the user associated with the token.- Returns:
- The user.
-
getAuthToken
Gets the authentication token.- Returns:
- The authentication token.
-
setExpiresAt
Sets the expiration timestamp of the token.- Parameters:
expiresAt- The expiration timestamp.
-
setUser
Sets the user associated with the token.- Parameters:
user- The user.
-
setAuthToken
Sets the authentication token.- Parameters:
authToken- The authentication token.
-