-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Aborting authentication throws a string instead of an error #359
Comments
There's not a lot of guidance on what a "proper"
And in the MDN docs for
I suppose the idea is that |
Note to self: this seems like a reasonable request so I'll go ahead with it. |
Thanks! I started looking into contributing this back via PR. The change itself seemed pretty straightforward, but testing it was causing some headaches. I'm interested to see your solution 😁 |
Note to self: I haven't forgotten about this, I'm just waiting till I land #367 and then this'll be a fast follow. It'll all get released as v7.2.0 (unless I discover a reason it all needs to go out as v8.0.0) when I finally merge everything pending in. |
@mhamann I just published @simplewebauthn/[email protected] that should resolve this issue 🚀 |
Describe the issue
Calling
startAuthentication(opts, false)
in the browser after a previous call tostartAuthentication(opts, true)
aborts the previous authentication flow. This causes the browser runtime to throw, which is good, but in this case, what's thrown is a string.When
navigator.credentials.get(...)
is aborted by anAbortController
, the browser runtime throws whatever you pass into.abort(reason)
(at least on Chromium-based browsers. Safari seems to ignore the abort signal entirely.).It seems like the reason passed to
abort
should be an instance ofError
instead.Reproduction Steps
Replacing the previous
aborter.abort(...)
with the following causes anError
to be thrown:Expected behavior
An
Error
should be thrown instead of a string.Dependencies
SimpleWebAuthn Libraries
The text was updated successfully, but these errors were encountered: