Skip to content

Commit 6a2b2ec

Browse files
committed
Add some logging around JWTs
1 parent 74d7bc6 commit 6a2b2ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/auth.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import (
55
"net/http"
66

77
jwt "github.com/dgrijalva/jwt-go"
8+
"github.com/sirupsen/logrus"
89
)
910

1011
// requireAuthentication checks incoming requests for tokens presented using the Authorization header
1112
func (a *API) requireAuthentication(w http.ResponseWriter, r *http.Request) (context.Context, error) {
13+
logrus.Info("Getting auth token")
1214
token, err := a.extractBearerToken(w, r)
1315
if err != nil {
1416
return nil, err
1517
}
1618

19+
logrus.Infof("Parsing JWT claims: %v", token)
1720
return a.parseJWTClaims(token, r)
1821
}
1922

0 commit comments

Comments
 (0)