Closed felixmosh closed 2 years ago
Hmm, I don't like the idea of calling an error "WebAuthnError" and then allowing for its name to be overridden so error.name
would never be "WebAuthnError"
. The better way to do this is probably to throw basic Error
's instead and set the name to the original WebAuthn error so that RPs like you can continue to rely on error.name
for detection. Then just drop "WebAuthnError"
completely so what the functionality really becomes is an overriding of the description of the error.
I experimented with some potential solutions tonight and after hitting a bunch of dead ends I do think your proposed solution is the only way forward. I'm going to request a fix, and once that's done this should be good to merge.
I've updated tests, thank you
@felixmosh Thank you for your contribution! This is a great improvement to the error detection logic 🚀
fixes #190