Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultUserKey = "user"
DefaultUserKey user
Variables ¶
View Source
var ( // ErrTokenMissing is the error value that it's returned when // a token is not found based on the token extractor. ErrTokenMissing = errors.New("this api requires authorization token") // ErrUserIDMissing is the error value when no user id found in jwt token ErrUserIDMissing = errors.New("authorization token missing user id") // ErrTokenType when parse jwt token, its type is not available type ErrTokenType = errors.New("token type error") )
Functions ¶
func ErrorHandler ¶
ErrorHandler is the default error handler. Use it to change the behavior for each error.
func IsAuthenticated ¶
IsAuthenticated is authentication middleware JWT middleware must be configured before this only when your api need be authenticated, you should configure this middleware, otherwise do not configure it
Types ¶
Click to show internal directories.
Click to hide internal directories.