jwt

package
v0.0.0-...-cccb129 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

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

func GenerateRefreshToken(sessionId primitive.ObjectID) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL