Documentation ¶
Index ¶
- Variables
- func GenerateJWT(customClaims *models.JwtCustomClaims) (string, error)
- func GenerateRefreshToken(sessionId primitive.ObjectID) (string, error)
- func VerifyJwtToken(jwtToken string) (*models.DefaultClaims, error)
- func VerifyRefreshToken(refreshToken string) (*models.RefreshTokenClaims, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var JWTSecretKey = []byte(os.Getenv("JWT_SECRET"))
JWTSecretKey is a secret key used to sign the JWT tokens.
Functions ¶
func GenerateJWT ¶
func GenerateJWT(customClaims *models.JwtCustomClaims) (string, error)
GenerateJWT creates a new JWT token with default claims.
func GenerateRefreshToken ¶
GenerateRefreshToken creates a new refresh token.
func VerifyJwtToken ¶
func VerifyJwtToken(jwtToken string) (*models.DefaultClaims, error)
func VerifyRefreshToken ¶
func VerifyRefreshToken(refreshToken string) (*models.RefreshTokenClaims, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.