Merge pull request #13301 from mitake/jwt-exp-log

server/auth: avoid logging for JWT token
This commit is contained in:
Hitoshi Mitake 2022-03-23 22:39:28 +09:00 committed by GitHub
commit 43e39d362d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,6 @@ func (t *tokenJWT) info(ctx context.Context, token string, rev uint64) (*AuthInf
if err != nil { if err != nil {
t.lg.Warn( t.lg.Warn(
"failed to parse a JWT token", "failed to parse a JWT token",
zap.String("token", token),
zap.Error(err), zap.Error(err),
) )
return nil, false return nil, false
@ -70,7 +69,7 @@ func (t *tokenJWT) info(ctx context.Context, token string, rev uint64) (*AuthInf
claims, ok := parsed.Claims.(jwt.MapClaims) claims, ok := parsed.Claims.(jwt.MapClaims)
if !parsed.Valid || !ok { if !parsed.Valid || !ok {
t.lg.Warn("invalid JWT token", zap.String("token", token)) t.lg.Warn("failed to obtain claims from a JWT token")
return nil, false return nil, false
} }