Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct {
UserID *string `json:"user_id"`
IsSubscribed *bool `json:"is_subscribed"`
Type *string `json:"type"`
Roles *[]string `json:"roles"`
jwt.RegisteredClaims
}
CustomClaims represents the custom claims in the JWT
func ValidateToken ¶
func ValidateToken(tokenString string, tokenType TokenType) (*CustomClaims, error)
ValidateToken verifies if a token is valid
type TokenDetails ¶
TokenDetails contains the token information
func GenerateToken ¶
func GenerateToken(userID primitive.ObjectID, tokenType TokenType) (*TokenDetails, error)
GenerateToken creates a new JWT token
Click to show internal directories.
Click to hide internal directories.