Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrJwtDecode is error message for get jwt claims failed ErrJwtDecode = errors.New("JWT Claims Failed") // DefaultKey is default jwt key we used DefaultKey = "you never know zcong" // JwtKey is jwt key we actually used JwtKey = utils.GetEnvOrDefault("JWTKEY", DefaultKey) // JwtMiddleware is jwt middleware for iris JwtMiddleware = jwtmiddleware.New(jwtmiddleware.Config{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { return []byte(JwtKey), nil }, SigningMethod: jwt.SigningMethodHS256, ErrorHandler: func(ctx iris.Context, err string) { ctx.StatusCode(iris.StatusUnauthorized) utils.ResponseErr(ctx, errors.New(err)) }, }) )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.