-
Notifications
You must be signed in to change notification settings - Fork 42
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
implement verify method #33
Conversation
Will it be merged in next release ? Just tried it from commit ref and it is working! |
I'm in holiday at the moment. I'll look at this when I'm back from Japan. |
Suure, no worries. Have fun there! 🇯🇵 |
Hi @rrousselGit , I hope you're enjoying your trip to Japan! Just wanted to gently remind you about this, awaiting your review when you have a chance. |
Looks like this needs testing. My apologies, I should've raised this sooner. I'll review other PRs and fix other bugs in the meantime. If it's still around by then, I'll consider adding tests for this myself :) |
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.
Cf above (testing)
token, | ||
SecretKey(''), | ||
); | ||
JWT.decode(token); |
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.
Why this change?
'The provided token has expired. Get a fresh token from your client app and try again.', | ||
); | ||
} on JWTException catch (e) { | ||
if (e.message.startsWith(jwtCallbackErrorPrefix)) { |
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.
We shouldn't depend on the english message.
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.
And then, how about simplifying this error handling for now?
Just like:
...
} on JWTExpiredException {
throw JwtError(
JwtErrorCode.tokenExpired,
'The provided token has expired. Get a fresh token from your client app and try again.',
);
} on JWTException catch (e) {
// Just throw JwtErrorCode.unknown for now.
throw JwtError(JwtErrorCode.unknown, e.message);
}
...
enum JwtErrorCode {
invalidArgument('invalid-argument'),
...
// add this enum field
unknown('unknown');
...
}
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.
Sure. I shouldn't have done that indeed.
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.
Hello!
I would appreciate it if you could take a moment to check these comments and share your thoughts.
This has been sorted in a different PR. Thanks for your work though and sorry for the slow review! |
Fixed issue: Auth#verifyIdToken always throws unimplemented error #20