ソースを参照

all device check expire

Paul 6 年 前
コミット
8d8eada3e7
共有1 個のファイルを変更した2 個の追加5 個の削除を含む
  1. 2
    5
      middleware/auth/auth.go

+ 2
- 5
middleware/auth/auth.go ファイルの表示

@@ -54,11 +54,8 @@ func Auth(authKey string) gin.HandlerFunc {
54 54
 		if mapClaims, ok := token.Claims.(jwt.MapClaims); ok {
55 55
 			if expired, ok := mapClaims[ctxRequestTokenExpired].(float64); ok {
56 56
 				if int64(expired) < time.Now().Unix() {
57
-					// Only cookie is blank value, check token expired
58
-					if _, err := ctx.Cookie(ctxRequestCookieAuthorization); err != nil {
59
-						ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"msg": "auth failed, token timeout"})
60
-						return
61
-					}
57
+					ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"msg": "auth failed, token timeout"})
58
+					return
62 59
 				}
63 60
 			}
64 61