Documentation
¶
Index ¶
Constants ¶
View Source
const ( JwtToken = "token" JwtAuth = "auth" JwtMsg = "msg" JwtUser = "user" JwtUsername = "username" JwtTokenError = "jwt is error" JwtTokenExpired = "jwt is expired" JwtTokenNotValidYet = "jwt is not valid yet" )
Variables ¶
View Source
var DefaultJwtConfig = &JwtConfig{
JwtExpiresTime: 60 * 60 * 24 * 7,
JwtSigningKey: "tinytok",
}
Functions ¶
func Auth ¶
func Auth() gin.HandlerFunc
func CreateToken ¶
func CreateToken(claims *UserClaims) (string, error)
func RefreshToken ¶
Types ¶
type UserClaims ¶
func ParseToken ¶
func ParseToken(tokenString string) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.