Skip to content

feat(elements): Add support for sign in with email_link via redirect_url - #3926

Merged
dstaley merged 5 commits into
mainfrom
ds.feat/elements-email-link-sign-in
Aug 15, 2024
Merged

feat(elements): Add support for sign in with email_link via redirect_url#3926
dstaley merged 5 commits into
mainfrom
ds.feat/elements-email-link-sign-in

Conversation

@dstaley

@dstaleydstaley commented Aug 9, 2024

Copy link
Copy Markdown
Member

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:

@changeset-bot

changeset-botBot commented Aug 9, 2024

Copy link
Copy Markdown

🦋 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
NameType
@clerk/elementsPatch

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

@dstaleydstaley 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_linkAug 9, 2024
params: context.currentFactor as PrepareFirstFactorParams,
params: {
...context.currentFactor,
redirectUrl: `${window.location.origin}${context.basePath}${MAGIC_LINK_VERIFY_PATH_ROUTE}`,

Copy link
Copy Markdown
MemberAuthor

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
@dstaleydstaley changed the title feat(elements): Add partial support for sign in with email_linkfeat(elements): Add support for sign in with email_link via redirect_urlAug 13, 2024

@alexcarpenteralexcarpenter left a comment

Copy link
Copy Markdown
Member

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 mainAug 15, 2024
@dstaley
dstaley deleted the ds.feat/elements-email-link-sign-in branch August 15, 2024 19:50
Sign up for freeto 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

@dstaley@alexcarpenter@clerk-cookie