Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

tkfinitefield
Copy link

Fixed issue: Auth#verifyIdToken always throws unimplemented error #20

@CLAassistant
Copy link

CLAassistant commented May 23, 2024

CLA assistant check
All committers have signed the CLA.

@davidcz95
Copy link

davidcz95 commented Jun 12, 2024

Will it be merged in next release ? Just tried it from commit ref and it is working!

@rrousselGit
Copy link
Collaborator

I'm in holiday at the moment. I'll look at this when I'm back from Japan.

@davidcz95
Copy link

davidcz95 commented Jun 12, 2024

Suure, no worries. Have fun there! 🇯🇵

@KKimj
Copy link
Contributor

KKimj commented Jun 28, 2024

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.

@rrousselGit
Copy link
Collaborator

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 :)

Copy link
Collaborator

@rrousselGit rrousselGit left a 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);
Copy link
Collaborator

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)) {
Copy link
Collaborator

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.

Copy link
Contributor

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');

  ...
}

Copy link
Collaborator

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkfinitefield

Hello!
I would appreciate it if you could take a moment to check these comments and share your thoughts.

@KKimj KKimj mentioned this pull request Jul 30, 2024
2 tasks
@labrom labrom mentioned this pull request Oct 9, 2024
2 tasks
@rrousselGit
Copy link
Collaborator

This has been sorted in a different PR. Thanks for your work though and sorry for the slow review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants