Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
create a jwt token using username or name, if token is a user set to `True` if agent `False`
func HashToNumber ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct {
jwt.RegisteredClaims
Name string `json:"name"`
IsUserToken bool `json:"is_user_token"`
}
jwt type
func VerifyToken ¶
func VerifyToken(jwtToken, secret string) (claims *CustomClaims, err error)
verifies the token and returns the `CustomClaims` struct and error
Click to show internal directories.
Click to hide internal directories.