Class GenerateAccessToken

java.lang.Object
api.mpba.rastvdmy.service.generator.GenerateAccessToken

@Component public class GenerateAccessToken extends Object
A service class for generating access tokens for user profiles.
  • Constructor Details

    • GenerateAccessToken

      @Autowired public GenerateAccessToken(JwtService jwtService, AccessTokenRepository tokenRepository)
      Constructs a GenerateAccessToken instance with the specified JwtService and AccessTokenRepository.
      Parameters:
      jwtService - the service used for generating JWT tokens
      tokenRepository - the repository for storing access tokens
  • Method Details

    • generate

      public GenerateAccessToken.TokenDetails generate(UserProfile userProfile)
      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