-
Notifications
You must be signed in to change notification settings - Fork 453
feat(elements): Add support for sign in with passkey #3472
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e70b37d
feat(elements): Add support for sign in with passkey
panteliselef c2d7611
feat(elements): Input field with passkey autofill
panteliselef 69e387f
feat(elements): Handle submit attempts when attempting passkey autofill
panteliselef ac84712
chore(elements): Remove redundant types
panteliselef 4af33d8
chore(elements): Improve code readability
panteliselef d12ecec
chore(elements): Add changeset
panteliselef f830e31
fix(elements): Add missing file
panteliselef 51d7def
chore(elements): Use dot notation for event type
panteliselef 01c42bf
chore(elements): Introduce `isNonPreperableStrategy`
panteliselef 4737f40
chore(shared,clerk-js,elements): Move webauthn utilities to shared
panteliselef d1ed9a9
Merge branch 'refs/heads/main' into elef/passkey-elements
panteliselef 7db4a1b
chore(elements): Sanitize props
panteliselef 0122832
chore(elements): Make passkey a standalone component
panteliselef 4c9e102
chore(elements): Update changeset
panteliselef 6fadabd
chore(elements): Move autofill support detection inside an actor
panteliselef 376190d
adjust changeset
LekoArts 12e6257
Address PR comments
panteliselef f899070
Address tests failing
panteliselef 0f5c3e3
Improve error handling
panteliselef 1d3344e
chore(elements): Drop `passkeyAutofill` and depend on `webauthn`
panteliselef 32344a9
Merge branch 'main' into elef/passkey-elements
panteliselef 3a0356d
chore(*): Update changeset
panteliselef 88477f4
chore(elements): Detect webauthn in with type `tel`
panteliselef d16809f
Merge branch 'main' into elef/passkey-elements
panteliselef File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| '@clerk/elements': minor | ||
| --- | ||
|
|
||
| Support passkeys in `<SignIn>` flows. | ||
|
|
||
| APIs introduced: | ||
| - `<SignIn.Passkey />` | ||
| - `<SignIn.SupportedStrategy name='passkey'>` | ||
| - `<SignIn.Strategy name='passkey'>` | ||
| - Detects the usage of `webauthn` to trigger passkey autofill `<Clerk.Input autoComplete="webauthn" />` | ||
|
|
||
| Usage examples: | ||
| - `<SignIn.Action passkey />` | ||
| ```tsx | ||
| <SignIn.Step name='start'> | ||
| <SignIn.Passkey> | ||
| <Clerk.Loading> | ||
| {isLoading => (isLoading ? <Spinner /> : 'Use passkey instead')}. | ||
| </Clerk.Loading> | ||
| </SignIn.Passkey> | ||
| </SignIn.Step> | ||
| ``` | ||
|
|
||
| - `<SignIn.SupportedStrategy name='passkey'>` | ||
| ```tsx | ||
| <SignIn.SupportedStrategy asChild name='passkey' > | ||
| <Button>use passkey</Button> | ||
| </SignIn.SupportedStrategy> | ||
| ``` | ||
|
|
||
| - `<SignIn.Strategy name='passkey'>` | ||
| ```tsx | ||
| <SignIn.Strategy name='passkey'> | ||
| <p className='text-sm'> | ||
| Welcome back <SignIn.Salutation />! | ||
| </p> | ||
|
|
||
| <CustomSubmit>Continue with Passkey</CustomSubmit> | ||
| </SignIn.Strategy> | ||
| ``` | ||
|
|
||
| - Passkey Autofill | ||
| ```tsx | ||
| <SignIn.Step name='start'> | ||
| <Clerk.Field name='identifier'> | ||
| <Clerk.Label className='sr-only'>Email</Clerk.Label> | ||
| <Clerk.Input autoComplete="webauthn" placeholder='Enter your email address' /> | ||
| <Clerk.FieldError /> | ||
| </Clerk.Field> | ||
| </SignIn.Step> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| '@clerk/shared': minor | ||
| --- | ||
|
|
||
| Move `isWebAuthnSupported`, `isWebAuthnAutofillSupported`, `isWebAuthnPlatformAuthenticatorSupported` to `@clerk/shared/webauthn`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Enabling "autofill" is kind of fire and forget action, so we should be able to recover from this state and not get stuck. Promise will await until user interact with the field and select a passkey and that may never happen.