-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add support for abort signal #52
Conversation
Thanks |
Hi, I merged this directly since it's backwards compatible ...but what's actually the use case for this abort signal? |
When adding support for conditional UI to a SPA (like react), the |
I would utilize the abort signal also. I initially call |
@JohnnyCrazy @hjaber Hi guys ...I got another dumb question. Since only chrome and safari support this passkeys conditional UI, how do you deal with other browsers? Do you simply ignore them, or do you have some fancy fallback? |
I do my best to make a fancy fallback but I mentally ignore the other browsers since there are a lot of edge cases to cover. I call authenticate() with a try/catch and if it catches, I then call it with |
shouldn't it be the other way round? Direct authentication is more widely supported than conditional one. For example, with Firefox and conditional mediation, it will simply do nothing. It won't throw an error. You have to check |
Duh... |
Apologies for the miscommunication! My goal in implementing a fallback is primarily to enhance the UI/UX experience, not necessarily to broaden support for different authentication methods. I do have an initial check that I did not mention to check if the client supports passkeys ( If passkeys are supported, I then attempt direct authentication. However, due to the inherent advantages and disadvantages of this approach, I've included a fallback for mediation. If mediation isn't supported, the process falls back to a magic link login. As you mentioned |
just wanted to clarify things to avoid potential readers being confused. The conditional mediation is something you trigger when the page loads to "activate" the autocomplete on the input. If this passkeys autocomplete does not work (like on FF), the fallback could be to trigger A couple of additional details:
|
Hi,
Adds support for passing a
AbortSignal
via the optionalsignal
property. This can be used to cancel credential requests, like when usingmediation: 'conditional'
.A react hook example:
As we add a new optional parameter, this should be backwards compatible.