-
Notifications
You must be signed in to change notification settings - Fork 1
React: conditionally render passkey method based on platform support #223
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
base: main
Are you sure you want to change the base?
Conversation
Deploying with
|
| Latest commit: |
c92fbb1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9a43ffdc.website-react-storybook.pages.dev |
| Branch Preview URL: | https://passkey-detect.website-react-storybook.pages.dev |
| @@ -0,0 +1,3 @@ | |||
| import { Utils } from "@slashid/slashid"; | |||
|
|
|||
| export const runtimeSupportsPasskeys = Utils.runtimeSupportsBestPasskeyUX(); | |||
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.
This might cause trouble if executed server side. Can we make sure this either runs client side only or gets parametrised so the user agent string is passed in? Server side we can read it from the HTTP request.
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.
I totally agree, I will need some help from you to consider SSR edge-cases since you're most familiar with the things we've previously delivered in this space.
|
|
||
| const passkeySupportDetectionLoading = showPasskeys === null; | ||
| if (passkeySupportDetectionLoading) { | ||
| return null; |
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.
Ideally this would be a skeleton or some sort of placeholder, so we can avoid layout shifts.
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.
Agreed
Adding passkey support detection to the auth method selector in
<Form>This PR is just barely working, full of debugs and in need of some TLC.
Coming soon!