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

feat: improve OAuth error handling #982

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

dphilipson
Copy link
Contributor

@dphilipson dphilipson commented Sep 24, 2024

Correctly read errors returned from the callback site. Also use a custom error type, OauthCancelledError, when the OAuth flow is cancelled because a user closed the popup window.


PR-Codex overview

This PR introduces new error handling for the OAuth flow in the AlchemySignerWebClient, adding two error classes: OauthCancelledError and OauthFailedError. It also updates the export structure to include these new errors.

Detailed summary

  • Updated exports in account-kit/signer/src/index.ts to include OauthCancelledError and OauthFailedError.
  • Added OauthCancelledError class extending BaseError with a constructor message for cancellation.
  • Added OauthFailedError class extending BaseError for errors during OAuth login.
  • Modified AlchemySignerWebClient to use the new error classes for handling OAuth errors.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Sep 24, 2024

You must have Developer access to commit code to Alchemy on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles

rthomare
rthomare previously approved these changes Sep 25, 2024
Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 6:37pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 6:37pm

Correctly read errors returned from the callback site. Also use a custom
error type, `OauthCancelledError`, when the OAuth flow is cancelled
because a user closed the popup window.
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.

3 participants