Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GetJWTSecretKey ¶
func GetJWTSecretKey() string
Types ¶
type JwtClaim ¶
type JwtClaim struct { UserID uint jwt.StandardClaims }
JwtClaim adds userid as a claim to the token
type JwtWrapper ¶
JwtWrapper wraps the signing key and the issuer
func (*JwtWrapper) SignToken ¶
func (j *JwtWrapper) SignToken(userid uint) (signedToken string, err error)
func (*JwtWrapper) ValidateToken ¶
func (j *JwtWrapper) ValidateToken(signedToken string) (claims *JwtClaim, err error)
ValidateToken validates the jwt token
Click to show internal directories.
Click to hide internal directories.