Skip to content

Commit

Permalink
fix token handler
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k committed Aug 31, 2023
1 parent 5154eda commit d539720
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controller/token.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controller

import (
"errors"
"fmt"
"net/http"

Expand All @@ -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
Expand Down

0 comments on commit d539720

Please sign in to comment.