Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClaimsSigning = errors.New("error on claims signing")
ErrClaimsSigning occurs in jwt signing, data safe.
View Source
var ErrMissingUIDString = errors.New("missing uid string")
ErrMissingUIDString occurs when given a struct without an UIDString.
View Source
var ErrUnexpectedSigningMethod = errors.New("unexpected signing method")
ErrUnexpectedSigningMethod is given if there is a signing method mismatch in the token header.
Functions ¶
func LoginToken ¶
LoginToken given a user, returns a JWT string, and its expiration.
func StructUIDToken ¶
StructUIDToken will given a struct with an UIDString, return a JWT certifying that the UID corresponds to that struct type.
func VerifyLoginToken ¶
VerifyLoginToken will given a JWT token, and a loginType as a string, returns true if the logintype matches and the token has not expired, false otherwise.
Types ¶
type LoginClaims ¶
type LoginClaims struct {
jwt.StandardClaims
}
LoginClaims are jwt standard claims, with LoginType (ltp in json)
Click to show internal directories.
Click to hide internal directories.