Class GenerateAccessToken
java.lang.Object
api.mpba.rastvdmy.service.generator.GenerateAccessToken
A service class for generating access tokens for user profiles.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
A record representing the details of the generated token. -
Constructor Summary
ConstructorDescriptionGenerateAccessToken
(JwtService jwtService, AccessTokenRepository tokenRepository) Constructs a GenerateAccessToken instance with the specified JwtService and AccessTokenRepository. -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(UserProfile userProfile) Generates an access token for the given user profile.
-
Constructor Details
-
GenerateAccessToken
Constructs a GenerateAccessToken instance with the specified JwtService and AccessTokenRepository.- Parameters:
jwtService
- the service used for generating JWT tokenstokenRepository
- the repository for storing access tokens
-
-
Method Details
-
generate
Generates an access token for the given user profile.- Parameters:
userProfile
- the user profile for which the access token will be generated- Returns:
- TokenDetails containing the generated token and its expiration time
-