Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JwtClaim ¶
type JwtClaim struct { Email string jwt.StandardClaims }
JwtClaim holds Email of the user along with jwt.StandardClaims
type JwtWrapper ¶
type JwtWrapper struct { SecretKey string // key used for signing the JWT token Issuer string // Issuer of the JWT token ExpirationMinutes int64 // Number in minutes the JWT token will be valid for }
JwtWrapper wraps the signing key, issuer and expiration time
func (*JwtWrapper) GenerateToken ¶
func (j *JwtWrapper) GenerateToken(email string) (signedToken string, err error)
Generates a JWT token based on the provided email
func (*JwtWrapper) ValidateToken ¶
func (j *JwtWrapper) ValidateToken(signedToken string) (claims *JwtClaim, err error)
Validates the JWT token and returns its claims
Click to show internal directories.
Click to hide internal directories.