Преглед на файлове

all device check expire

Paul преди 6 години
родител
ревизия
8d8eada3e7
променени са 1 файла, в които са добавени 2 реда и са изтрити 5 реда
  1. 2
    5
      middleware/auth/auth.go

+ 2
- 5
middleware/auth/auth.go Целия файл

54
 		if mapClaims, ok := token.Claims.(jwt.MapClaims); ok {
54
 		if mapClaims, ok := token.Claims.(jwt.MapClaims); ok {
55
 			if expired, ok := mapClaims[ctxRequestTokenExpired].(float64); ok {
55
 			if expired, ok := mapClaims[ctxRequestTokenExpired].(float64); ok {
56
 				if int64(expired) < time.Now().Unix() {
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