mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
fix(web): misleading 2fa registration errors (#2535)
This commit is contained in:
parent
1ea94dd403
commit
0e8ff3bde9
|
@ -47,7 +47,15 @@ const RegisterOneTimePassword = function () {
|
|||
setSecretBase32(secret.base32_secret);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
createErrorNotification("Failed to generate the code to register your device", 10000);
|
||||
if ((err as Error).message.includes("Request failed with status code 403")) {
|
||||
createErrorNotification(
|
||||
"You must open the link from the same device and browser that initiated the registration process",
|
||||
);
|
||||
} else {
|
||||
createErrorNotification(
|
||||
"Failed to register device, the provided link is expired or has already been used",
|
||||
);
|
||||
}
|
||||
setHasErrored(true);
|
||||
}
|
||||
setIsLoading(false);
|
||||
|
|
|
@ -46,9 +46,15 @@ const RegisterSecurityKey = function () {
|
|||
navigate(FirstFactorPath);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
createErrorNotification(
|
||||
"Failed to register your security key. The identity verification process might have timed out.",
|
||||
);
|
||||
if ((err as Error).message.includes("Request failed with status code 403")) {
|
||||
createErrorNotification(
|
||||
"You must open the link from the same device and browser that initiated the registration process",
|
||||
);
|
||||
} else {
|
||||
createErrorNotification(
|
||||
"Failed to register your security key. The identity verification process might have timed out.",
|
||||
);
|
||||
}
|
||||
}
|
||||
}, [processToken, createErrorNotification, navigate]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user