diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 6bac875f..d903f06f 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -20,6 +20,7 @@ diff --git a/frontend/src/pages/auth/login.vue b/frontend/src/pages/auth/login.vue index 340e343c..bbac3036 100644 --- a/frontend/src/pages/auth/login.vue +++ b/frontend/src/pages/auth/login.vue @@ -70,7 +70,11 @@ async function loginWebAuthN() { }); await finish(response); } catch (e) { - notification.fromError(i18n, e); + if (e?.toString()?.startsWith("NotAllowedError")) { + notification.error("Security Key Authentication failed!"); + } else { + notification.fromError(i18n, e); + } } loading.value = false; } diff --git a/frontend/src/pages/auth/settings/security.vue b/frontend/src/pages/auth/settings/security.vue index 8e4ec6fc..2cf330d0 100644 --- a/frontend/src/pages/auth/settings/security.vue +++ b/frontend/src/pages/auth/settings/security.vue @@ -58,6 +58,8 @@ async function addAuthenticator() { savedRequest.value = e.config; } else if (e.response?.data?.detail === "error.privileged") { await router.push(useAuth.loginUrl(route.path) + "&privileged=true"); + } else if (e?.toString()?.startsWith("NotAllowedError")) { + notification.error("Security Key Authentication failed!"); } else { notification.fromError(i18n, e); } @@ -73,6 +75,8 @@ async function unregisterAuthenticator(authenticator: AuthSettings["authenticato } catch (e) { if (e.response?.data?.detail === "error.privileged") { await router.push(useAuth.loginUrl(route.path) + "&privileged=true"); + } else if (e?.toString()?.startsWith("NotAllowedError")) { + notification.error("Security Key Authentication failed!"); } else { notification.fromError(i18n, e); }