添加6401 token 过期状态
This commit is contained in:
1 parent
bf494c2131
commit
8630a8c784
1 file changed
+1
-3
@@ -391,7 +391,7 @@ func (mw *GinJWTMiddleware) middlewareImpl(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if int64(claims["exp"].(float64)) < mw.TimeFunc().Unix() {
|
||||
mw.unauthorized(c, http.StatusUnauthorized, mw.HTTPStatusMessageFunc(ErrExpiredToken, c))
|
||||
mw.unauthorized(c, 6401, mw.HTTPStatusMessageFunc(ErrExpiredToken, c))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -680,8 +680,6 @@ func (mw *GinJWTMiddleware) ParseToken(c *gin.Context) (*jwt.Token, error) {
|
||||
if mw.usingPublicKeyAlgo() {
|
||||
return mw.pubKey, nil
|
||||
}
|
||||
|
||||
// save token string if vaild
|
||||
c.Set("JWT_TOKEN", token)
|
||||
|
||||
return mw.Key, nil
|
||||
|
||||
Reference in new issue
Block a user