Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QRCode features #217

Merged
merged 7 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/satosa/pyeudiw_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config:
qrcode:
size: 100
color: '#2B4375'
expiration_time: 120 # seconds
logo_path:
use_zlib: false

Expand Down
14 changes: 6 additions & 8 deletions example/satosa/templates/qr_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
<p id="content-qrcode-info-text" class="text-helper text-info">
Il codice è valido per <b id="timer"></b> secondi
</p>
<p class="">
<a href="javascript:window.location.reload(true)"><b>Ho bisogno di più tempo</b></a>
</p>
<p id="content-qrcode-subtitle" class="qr-code-text" hidden>
Puoi trovarla direttamente all'interno dell'app IO.
Se hai più dispositivi mobili,
Expand All @@ -42,7 +39,6 @@
<span>Indietro</span>
</button>
</div>

</div>
</div>
</div>
Expand All @@ -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 = "<b>Non hai ricevuto la notifica?</b>";
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);
}

Expand Down Expand Up @@ -115,6 +111,8 @@

function QRcodeExpired(){
console.log('session expired');
blankQRcode();
clearInterval(countdown);
changeQrCodeInfo(qrCodeExpiredInfo);
}

Expand Down
1 change: 1 addition & 0 deletions pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions pyeudiw/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"qrcode": {
"size": 100,
"color": "#2B4375",
"expiration_time": 120,
},
"jwt": {
"default_sig_alg": "ES256",
Expand Down
Loading