From 52623e5b02abcff505edb7568b348399faad13a7 Mon Sep 17 00:00:00 2001 From: Joost van Dijk Date: Tue, 5 Jul 2016 15:21:17 +0200 Subject: [PATCH] add missing error messages in tiqr idp --- www/tiqr/locales/en.yml | 6 +++++- www/tiqr/locales/nl.yml | 5 ++++- www/tiqr/views/index.html | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/www/tiqr/locales/en.yml b/www/tiqr/locales/en.yml index c2e8e57d..39686512 100644 --- a/www/tiqr/locales/en.yml +++ b/www/tiqr/locales/en.yml @@ -14,9 +14,13 @@ login: message: If the instructions on your phone instruct you to login manually, click %link_start%here%link_end%. userid: User ID otp: One time password - button: Go + button: Ok no_account: No account yet? Please create a new account %link_start%here%link_end%. cancel: Cancel + error: + invalid_challenge: Invalid challenge - please reload this page and try again. + invalid_response: Invalid response - have you entered the correct PIN? + enrol: title: Register new Tiqr account status: diff --git a/www/tiqr/locales/nl.yml b/www/tiqr/locales/nl.yml index f7e067b3..d44f1bf5 100644 --- a/www/tiqr/locales/nl.yml +++ b/www/tiqr/locales/nl.yml @@ -14,9 +14,12 @@ login: message: Krijg je een melding op je telefoon om handmatig in te loggen? Klik dan %link_start%hier%link_end%. userid: User ID otp: One time password - button: Go + button: Ok no_account: Geen account? Maak er dan %link_start%hier%link_end% eerst een aan. cancel: Annuleren + error: + invalid_challenge: ongeldig - herlaad deze pagina en probeer opnieuw. + invalid_response: ongeldig one time password - heb je de juiste PIN ingevoerd? enrol: title: Registreer nieuw Tiqr-account status: diff --git a/www/tiqr/views/index.html b/www/tiqr/views/index.html index 0ebb0c7e..97f70488 100644 --- a/www/tiqr/views/index.html +++ b/www/tiqr/views/index.html @@ -28,6 +28,11 @@ }); } jQuery(document).ready(verifyLogin); + + var errors = { + INVALID_CHALLENGE:"{{ 'error.invalid_challenge' | trans }}", + INVALID_RESPONSE:"{{ 'error.invalid_response' | trans }}" + }
@@ -110,7 +115,7 @@

{{ 'login.title' | trans }}

$.post(url, request, function(data){ if( data != "OK" ) - $( "#result" ).empty().append( "Error: " + data ); + $( "#result" ).empty().append( "Error: " + errors[data] ); }); });