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(elements): Add support for sign in with email_link via redirect_url #3926

Merged
merged 5 commits into from
Aug 15, 2024

Conversation

dstaley
Copy link
Member

@dstaley dstaley commented Aug 9, 2024

Description

This PR adds the required redirectUrl parameter to the prepare call for email_link first factor verification. Currently this only work if Account Portal is disabled.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Aug 9, 2024

🦋 Changeset detected

Latest commit: 57061c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dstaley dstaley changed the title feat(elements): Add partial support for sign in with email_link first… feat(elements): Add partial support for sign in with email_link Aug 9, 2024
params: context.currentFactor as PrepareFirstFactorParams,
params: {
...context.currentFactor,
redirectUrl: `${window.location.origin}${context.basePath}${MAGIC_LINK_VERIFY_PATH_ROUTE}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

It might make sense for this URL to be built somewhere else. In clerk-js we have a buildURL helper that handles appending the origin based on the routing type.

@dstaley dstaley marked this pull request as ready for review August 13, 2024 20:13
@dstaley dstaley changed the title feat(elements): Add partial support for sign in with email_link feat(elements): Add support for sign in with email_link via redirect_url Aug 13, 2024
Copy link
Member

@alexcarpenter alexcarpenter left a comment

Choose a reason for hiding this comment

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

Tested the flow, and successfully signing in via email link flows

@dstaley dstaley merged commit a39e56c into main Aug 15, 2024
19 checks passed
@dstaley dstaley deleted the ds.feat/elements-email-link-sign-in branch August 15, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants