mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Merge pull request #3889 from alphagov/webauthn-errors
Handle errors when registration fails
This commit is contained in:
@@ -27,7 +27,16 @@
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw Error(response.statusText);
|
||||
return response.arrayBuffer()
|
||||
.then((cbor) => {
|
||||
return Promise.resolve(window.CBOR.decode(cbor));
|
||||
})
|
||||
.catch(() => {
|
||||
throw Error(response.statusText);
|
||||
})
|
||||
.then((text) => {
|
||||
throw Error(text);
|
||||
});
|
||||
}
|
||||
|
||||
window.location.reload();
|
||||
|
||||
Reference in New Issue
Block a user