Skip to content

feat(clerk-js): Use passkey as first factor in <SignIn/>#3000

Merged
panteliselef merged 16 commits intomainfrom
elef/sdk-1402-ui-sign-in-passkey
Mar 19, 2024
Merged

feat(clerk-js): Use passkey as first factor in <SignIn/>#3000
panteliselef merged 16 commits intomainfrom
elef/sdk-1402-ui-sign-in-passkey

Conversation

@panteliselef
Copy link
Copy Markdown
Contributor

@panteliselef panteliselef commented Mar 15, 2024

Description

Things to consider

  • Unit tests will be part of follow up PR
  • This is behind a FF controlled by FAPI.

Autofill Passkey

Screen.Recording.2024-03-15.at.1.14.48.PM.mov

Discoverable Passkeys

Screen.Recording.2024-03-15.at.1.15.43.PM.mov

Sign in with identifier + passkeys as first factor

Screen.Recording.2024-03-15.at.1.15.56.PM.mov

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:

@panteliselef panteliselef requested a review from desiprisg March 15, 2024 11:12
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 15, 2024

🦋 Changeset detected

Latest commit: 7163d99

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

This PR includes changesets to release 12 packages
Name Type
@clerk/clerk-js Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/backend Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch
@clerk/themes 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

const credential = (await navigator.credentials.get({
publicKey: publicKeyOptions,
mediation: conditionalUI ? 'conditional' : 'optional',
signal: __internal_WebAuthnAbortService.createAbortSignal(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only one call to retrieve credentials can exist at time.

That means in the case of autofill user may never interact with it, this makes sure that every new call to retrieve the credentials will cancel the previews one.

Comment on lines +44 to +53
<Icon
elementDescriptor={descriptors.passkeyIcon}
icon={Fingerprint}
sx={t => ({
color: t.colors.$neutralAlpha500,
marginInline: 'auto',
paddingBottom: t.sizes.$1,
width: t.sizes.$12,
height: t.sizes.$12,
})}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@desiprisg @anagstef Please let me know if we have new patterns that this code should align with.

In the designs this icon have a size of 48x48 which is not covered by the current Icon implementation and just adding an xl variant does not feel right as the lg represents a 20x20 so the difference would be quite large between them.

We may add a new Header.Icon component, but as long as this is used in only one place do we need them to ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe the Header.Icon will make sense in order to have a proper descriptor instead of the passkeyIcon descriptor. WDYT ?

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.

It's ok to keep the width and height values.

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.

I'd say we don't add a Header.Icon yet. Let's keep the Icon as is for now. :)

Comment thread packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx Outdated
Comment thread packages/clerk-js/src/core/resources/SignIn.ts Outdated
@panteliselef panteliselef marked this pull request as ready for review March 15, 2024 13:15
@panteliselef panteliselef force-pushed the elef/sdk-1402-ui-sign-in-passkey branch from 32e070c to b9f8bf3 Compare March 15, 2024 21:00
Copy link
Copy Markdown
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Left a non-blocking comment.

I'd also make sure that your question is answered 👍

},
passkey: {
title: 'Use your passkey',
subtitle: "Using your passkey confirms it's you. Your device may ask for your fingerprint, face or screen lock.",
Copy link
Copy Markdown
Contributor

@LekoArts LekoArts Mar 19, 2024

Choose a reason for hiding this comment

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

Suggested change
subtitle: "Using your passkey confirms it's you. Your device may ask for your fingerprint, face or screen lock.",
subtitle: "Your device may ask for your fingerprint, face or screen lock.",

The first sentence feels like a filler sentence so this seems more concise.

What do you mean by "screen lock" exactly? Do you mean the phone PIN? If yes, that wasn't clear to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @LekoArts this text is copied from the designs. I'm sure we can iterate more on this as more people use it during the beta. Yes, by "screen lock" we mean a PIN.

@panteliselef panteliselef enabled auto-merge (squash) March 19, 2024 16:22
@panteliselef panteliselef force-pushed the elef/sdk-1402-ui-sign-in-passkey branch from 78ee4fd to 7163d99 Compare March 19, 2024 16:22
@panteliselef panteliselef merged commit ebf9be7 into main Mar 19, 2024
@panteliselef panteliselef deleted the elef/sdk-1402-ui-sign-in-passkey branch March 19, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants