-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authenticator: remove jwt.Validate #91
Conversation
jwt.Validate is already called in Verifier, no need to call it twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Makes sense.
Already called in Verifier:
Lines 114 to 116 in 127ee7c
if err := jwt.Validate(token, ja.validateOptions...); err != nil { | |
return token, ErrorReason(err) | |
} |
Looking at the Verifier implementation, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@klaidliadon this is exactly what we discussed last week.
@VojtechVitek Hi! Wondering if my previous message might have slipped through - would really appreciate your thoughts when you have a moment. |
I guess it can happen if someone forgets to apply Verifier middleware or have a custom verifier that returns nil. |
please leave the code the way it is for extra safety as Vojtech mentioned |
jwt.Validate is already called in Verifier, no need to call it twice.
If jwt.Validate fails in
Verifier
, the error is set in thecontext
and the Authenticator retrieves the token and error from thecontext
.