From 7927fe648342d41c8b5d4985204e91caf21e86c0 Mon Sep 17 00:00:00 2001 From: Matthieu Lamalle Date: Tue, 21 Jul 2020 11:21:39 +0200 Subject: [PATCH] update error return --- middleware/accounts.go | 1 + 1 file changed, 1 insertion(+) diff --git a/middleware/accounts.go b/middleware/accounts.go index ffdce8c..7e6746a 100644 --- a/middleware/accounts.go +++ b/middleware/accounts.go @@ -274,6 +274,7 @@ func ValidateToken(w http.ResponseWriter, r *http.Request) (*TokenDetails, error w.WriteHeader(http.StatusForbidden) w.Header().Add("Content-Type", "application/json") respond(w, response) + return tk, errors.New("Missing auth token") } splitted := strings.Split(bearToken, " ") //The token normally comes in format `Bearer {token-body}`, we check if the retrieved token matched this requirement