From e8838f475e7ba90409ff3a368be88c19711c4255 Mon Sep 17 00:00:00 2001 From: Umputun Date: Fri, 25 May 2018 17:08:21 -0500 Subject: [PATCH] reduce dbg level of failed auth msg --- app/rest/auth/auth.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/rest/auth/auth.go b/app/rest/auth/auth.go index 42baf3b0..4cf17464 100644 --- a/app/rest/auth/auth.go +++ b/app/rest/auth/auth.go @@ -41,7 +41,7 @@ func (a *Authenticator) Auth(reqAuth bool) func(http.Handler) http.Handler { claims, err := a.JWTService.Get(r) if err != nil && reqAuth { // in full auth lack of session causes Unauthorized - log.Printf("[WARN] failed auth, %s", err) + log.Printf("[DEBUG] failed auth, %s", err) http.Error(w, "Unauthorized", http.StatusUnauthorized) return } @@ -52,6 +52,7 @@ func (a *Authenticator) Auth(reqAuth bool) func(http.Handler) http.Handler { } if claims.User == nil && reqAuth { + log.Print("[DEBUG] failed auth, no user info presented in the claim") http.Error(w, "Unauthorized", http.StatusUnauthorized) return } @@ -61,7 +62,7 @@ func (a *Authenticator) Auth(reqAuth bool) func(http.Handler) http.Handler { user.Admin = isAdmin(user.ID, a.Admins) // dbl-check for admin to reset admin flag even if token has it // refresh token if it close to expiration if _, err := a.JWTService.Refresh(w, r); err != nil { - log.Printf("[WARN] can't refresh jwt, %s", err) + log.Printf("[DEBUG] can't refresh jwt, %s", err) } r = rest.SetUserInfo(r, user) }