Documentation
¶
Index ¶
- func NewRepository(redisClient *redis.Client) *redisTokenRepository
- type RefreshTokenData
- type TokenService
- func (t TokenService) GetTokens(user *model.User, previousRefreshTokenId string, rememberMe bool) (*Tokens, error)
- func (t TokenService) RefreshAccessToken(accessToken string) (string, error)
- func (t TokenService) SignOut(userId uint) error
- func (t TokenService) ValidateRefreshToken(ctx context.Context, tokenString string) (*RefreshTokenData, error)
- type Tokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRepository ¶
Types ¶
type RefreshTokenData ¶
type TokenService ¶ added in v0.64.0
type TokenService struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( logger *slog.Logger, tokenRepository repository, privateKey *rsa.PrivateKey, accessTokenExpirationSeconds int, refreshTokenSecretKey string, refreshTokenExpirationSeconds int, refreshTokenRememberMeExpirationSeconds int, ) (*TokenService, error)
func (TokenService) RefreshAccessToken ¶ added in v0.64.0
func (t TokenService) RefreshAccessToken(accessToken string) (string, error)
func (TokenService) SignOut ¶ added in v0.64.0
func (t TokenService) SignOut(userId uint) error
func (TokenService) ValidateRefreshToken ¶ added in v0.64.0
func (t TokenService) ValidateRefreshToken(ctx context.Context, tokenString string) (*RefreshTokenData, error)
Click to show internal directories.
Click to hide internal directories.