From d53972014068b253d15b4d1d396fe9da0d4b1efe Mon Sep 17 00:00:00 2001 From: Markus Wiegand Date: Thu, 31 Aug 2023 19:44:55 +0200 Subject: [PATCH] fix token handler --- controller/token.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/token.go b/controller/token.go index 12d5dd7..4653df1 100644 --- a/controller/token.go +++ b/controller/token.go @@ -1,6 +1,7 @@ package controller import ( + "errors" "fmt" "net/http" @@ -22,7 +23,7 @@ func TokenGET(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { } clm, err := jwt.VerifyToken(t) - if err != nil && err != jwt.ErrExpiredToken { + if err != nil && !errors.Is(err, jwt.ErrExpiredToken) { jwt.AddAuthenticateHeader(w, err) StatusUnauthorized(err.Error()).Render(w) return