Documentation
¶
Index ¶
- Variables
- type Handler
- func (h *Handler) CheckToken(ctx *gin.Context) (JwtClaims, error)
- func (h *Handler) ClearToken(ctx *gin.Context) error
- func (h *Handler) ExtractToken(ctx *gin.Context) (JwtClaims, error)
- func (h *Handler) GenToken(ctx *gin.Context, uid int64) (string, string, error)
- func (h *Handler) RefreshToken(ctx *gin.Context) (string, error)
- type JWT
- type JwtClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSessionInvalid = errors.New("session invalid") ErrNoAuthorization = errors.New("no authorization") ErrTokenInvalid = errors.New("token invalid") )
View Source
var ( JWTKey = []byte("k6CswdUm77WKcbM68UQUuxVsHSpTCwgK") RfJWTKey = []byte("k6CswdUm77WKcbM68UQUuxVsHSpTCwgA") )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) CheckToken ¶
CheckToken check if the token is valid and token is not logged out
func (*Handler) ClearToken ¶
ClearToken add ssid to redis to mark token as logged out
func (*Handler) ExtractToken ¶
ExtractToken extracts the token from auth header
Click to show internal directories.
Click to hide internal directories.