authorize: reduce log noise for empty jwt (#793)

This commit is contained in:
Caleb Doxsey 2020-05-27 15:34:15 -06:00 committed by GitHub
parent 748ab836b6
commit b16bc5e090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -77,6 +77,10 @@ func getJWTSetCookieHeaders(cookieStore sessions.SessionStore, rawjwt []byte) (m
}
func getJWTClaimHeaders(options config.Options, encoder encoding.MarshalUnmarshaler, rawjwt []byte) (map[string]string, error) {
if len(rawjwt) == 0 {
return make(map[string]string), nil
}
var claims map[string]jwtClaim
err := encoder.Unmarshal(rawjwt, &claims)
if err != nil {