Skip to content
Snippets Groups Projects
Verified Commit 662b0906 authored by Pavel Břoušek's avatar Pavel Břoušek
Browse files

fix: improve error messages

parent b84f82e9
Branches
Tags
No related merge requests found
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"en": "Unable to proceed with Web Authn because the context is insecure!" "en": "Unable to proceed with Web Authn because the context is insecure!"
}, },
"alert_webauthn_unavailable": { "alert_webauthn_unavailable": {
"en": "Could not load WebAuthn library. Please try again or use other token." "en": "Could not load WebAuthn, your device probably does not support it. Please try again or use another method."
}, },
"alert_webAuthnSignRequest_error": { "alert_webAuthnSignRequest_error": {
"en": "Error while signing WebAuthnSignRequest:" "en": "Error while signing WebAuthnSignRequest:"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"en": "Unable to proceed with U2F because the context is insecure!" "en": "Unable to proceed with U2F because the context is insecure!"
}, },
"alert_u2f_unavailable": { "alert_u2f_unavailable": {
"en": "Could not load U2F library. Please try again or use other token." "en": "Could not load U2F, your device probably does not support it. Please try again or use another method."
}, },
"alert_U2FSignRequest_error": { "alert_U2FSignRequest_error": {
"en": "Error while signing U2FSignRequest:" "en": "Error while signing U2FSignRequest:"
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
"tryAgain": { "tryAgain": {
"en": "Try Again" "en": "Try Again"
}, },
"incorrect_otp": { "error_message": {
"en": "You have entered incorrect OTP. Please try again or use another token." "en": "Verification was not successful. Please try again."
}, },
"error": { "error": {
"en": "Error " "en": "Error "
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
"cs": "Není možné použít autentizaci WebAuthn, protože neodpovídá bezpečnostní kontext." "cs": "Není možné použít autentizaci WebAuthn, protože neodpovídá bezpečnostní kontext."
}, },
"alert_webauthn_unavailable": { "alert_webauthn_unavailable": {
"cs": "Načtení WebAuthn knihovny se nezdařilo. Zkuste to znovu nebo použijte jiný token." "cs": "Načtení WebAuthn se nezdařilo, nejspíš ho Vaše zařízení nepodporuje. Zkuste to znovu nebo použijte jinou metodu."
}, },
"alert_webAuthnSignRequest_error": { "alert_webAuthnSignRequest_error": {
"cs": "Chyba při podepisování WebAuthnSignRequest:" "cs": "Chyba při podepisování WebAuthnSignRequest:"
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"cs": "Není možné použít autentizaci U2F, protože neodpovídá bezpečnostní kontext." "cs": "Není možné použít autentizaci U2F, protože neodpovídá bezpečnostní kontext."
}, },
"alert_u2f_unavailable": { "alert_u2f_unavailable": {
"cs": "Načtení U2F knihovny se nezdařilo. Zkuste to znovu nebo použijte jiný token." "cs": "Načtení U2F se nezdařilo, nejspíš ho Vaše zařízení nepodporuje. Zkuste to znovu nebo použijte jinou metodu."
}, },
"alert_U2FSignRequest_error": { "alert_U2FSignRequest_error": {
"cs": "Chyba při podepisování U2FSignRequest:" "cs": "Chyba při podepisování U2FSignRequest:"
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
"de": "Nochmal versuchen", "de": "Nochmal versuchen",
"nl": "Probeer opnieuw" "nl": "Probeer opnieuw"
}, },
"incorrect_otp": { "error_message": {
"cs": "Zadali jste nesprávné jednorázové heslo. Zkuste to znovu nebo použijte jiný token." "cs": "Ověření nebylo úspěšné. Zkuste to znovu nebo použijte jinou metodu."
}, },
"error": { "error": {
"cs": "Chyba " "cs": "Chyba "
......
...@@ -39,14 +39,9 @@ $tpl->data['errorCode'] = null; ...@@ -39,14 +39,9 @@ $tpl->data['errorCode'] = null;
$tpl->data['errorMessage'] = null; $tpl->data['errorMessage'] = null;
if (!empty($state['privacyidea:privacyidea']['errorCode']) || !empty($state['privacyidea:privacyidea']['errorMessage'])) { if (!empty($state['privacyidea:privacyidea']['errorCode']) || !empty($state['privacyidea:privacyidea']['errorMessage'])) {
if (!empty($state['privacyidea:privacyidea']['errorCode'])) { $tpl->data['errorCode'] = ($state['privacyidea:privacyidea']['errorCode'] ?? null) ?: '';
$tpl->data['errorCode'] = $state['privacyidea:privacyidea']['errorCode']; $state['privacyidea:privacyidea']['errorCode'] = ''
$state['privacyidea:privacyidea']['errorCode'] = ''; $tpl->data['errorMessage'] = $tpl->t('{privacyidea:privacyidea:error_message}');
$tpl->data['errorMessage'] = $state['privacyidea:privacyidea']['errorMessage'];
} else {
$tpl->data['errorCode'] = '';
$tpl->data['errorMessage'] = $tpl->t('{privacyidea:privacyidea:incorrect_otp}');
}
$state['privacyidea:privacyidea']['errorMessage'] = ''; $state['privacyidea:privacyidea']['errorMessage'] = '';
$stateId = State::saveState($state, 'privacyidea:privacyidea'); $stateId = State::saveState($state, 'privacyidea:privacyidea');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment