-
-
Notifications
You must be signed in to change notification settings - Fork 179
Open
Description
Proposal
It would be great if server lib had codes for errors.
There are such error codes for frontend - #367 .
Consider example -
- you want to run some logic if counter is lower than expected,
- and you want to run another logic if origin mismathes
- else rethrow
I want to it to look like this in my code:
try {
const verification = await verifyAuthenticationResponse({
...
});
} catch (error: WebAuthnError) {
if (error.code === 'COUNTER_TOO_LOW') {
// logout user
// delete passkey
} else if (error.code === 'ORIGIN_MISMATCH'){
throw new Error('I'm a teapot');
} else {
throw error;
}
}Just say what do you think about it generally and we can start discussing implementation details.
I want to contribute.
P.S.: thank you for such great library
spock123, Valerionn and freeatnet
Metadata
Metadata
Assignees
Labels
No labels