diff --git a/example/satosa/pyeudiw_backend.yaml b/example/satosa/pyeudiw_backend.yaml index 795e0565..a7ce44ab 100644 --- a/example/satosa/pyeudiw_backend.yaml +++ b/example/satosa/pyeudiw_backend.yaml @@ -21,6 +21,7 @@ config: qrcode: size: 100 color: '#2B4375' + expiration_time: 120 # seconds logo_path: use_zlib: false diff --git a/example/satosa/templates/qr_code.html b/example/satosa/templates/qr_code.html index 5ec1f997..f511e7ab 100644 --- a/example/satosa/templates/qr_code.html +++ b/example/satosa/templates/qr_code.html @@ -25,9 +25,6 @@
Il codice è valido per secondi
-Puoi trovarla direttamente all'interno dell'app IO. Se hai più dispositivi mobili, @@ -42,7 +39,6 @@ Indietro - @@ -65,17 +61,17 @@ let startingConnectionTitle = "Continua sul tuo smartphone"; let startingConnectionText = "Per proseguire, segui le istruzioni sull'app IO e autorizza l'accesso"; - let clickAccessLabel = "Clicca qui per accedere al servizio"; + let startingConnectionQRInfo = "Non hai ricevuto la notifica?"; + let clickAccessLabel = "Clicca qui per accedere al servizio"; let connectedTitle = "Autenticazione completata"; let qrCodeExpiredInfo = "Il codice QR non è più valido"; - let expirationTime = 120; + let expirationTime = "{{ qrcode_expiration_time }}"; let pollingInterval; function StartQRcodeScanCheck(){ - $('#timer').text(expirationTime); + $('#timer').text(expirationTime); let timeout = expirationTime*1000; - // setTimeout(timeout); pollingInterval = setTimeout(QRcodeScanCheck, timeout); } @@ -115,6 +111,8 @@ function QRcodeExpired(){ console.log('session expired'); + blankQRcode(); + clearInterval(countdown); changeQrCodeInfo(qrCodeExpiredInfo); } diff --git a/pyeudiw/satosa/backend.py b/pyeudiw/satosa/backend.py index 3c00a6dd..f9d20258 100644 --- a/pyeudiw/satosa/backend.py +++ b/pyeudiw/satosa/backend.py @@ -207,6 +207,7 @@ def pre_request_endpoint(self, context: Context, internal_request, **kwargs) -> { "qrcode_color" : self.config["qrcode"]["color"], "qrcode_text": res_url, + "qrcode_expiration_time": self.config["qrcode"]["expiration_time"], "state": state, "status_endpoint": self.absolute_status_url } diff --git a/pyeudiw/tests/settings.py b/pyeudiw/tests/settings.py index 31b2251b..784031d9 100644 --- a/pyeudiw/tests/settings.py +++ b/pyeudiw/tests/settings.py @@ -36,6 +36,7 @@ "qrcode": { "size": 100, "color": "#2B4375", + "expiration_time": 120, }, "jwt": { "default_sig_alg": "ES256",