Skip to content

Commit

Permalink
more IRMA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saravahdatipour committed Nov 21, 2024
1 parent 836d861 commit ff1699a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h4>
app (<a style="font-weight: 500;text-decoration: underline;" target="blank"
href="https://privacybydesign.foundation/download/">download</a> en
<a style="font-weight: 500;text-decoration: underline;" target="blank"
href="https://services.nijmegen.nl/irma/gemeente/start">vullen</a>) om
href="https://yivi.nijmegen.nl/login"">vullen</a>) om
op een privacy-vriendelijke manier aan te tonen dat je
oud genoeg bent om een van deze games te kopen.</span>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ div#line1:hover span#b {
padding: 0px;
}

#irma-info {
#yivi-info {
padding: 15px 0px 0px 0px !important;
text-align: center !important;
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h4>
oud genoeg bent om een van deze games te kopen.</span>
</h4>
</div>
<div id="irma-info" style="text-align: right; width: 30%; padding-top: 20px; padding-right: 25px;">
<div id="yivi-info" style="text-align: right; width: 30%; padding-top: 20px; padding-right: 25px;">
<h4><a target="blank" style="font-weight: 700;text-decoration: underline;"
href="http://www.yivi.app">Yivi?</a>

Expand Down
19 changes: 6 additions & 13 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,20 @@
if (location.pathname.includes('cart.html') && !sessionStorage.getItem('productid'))
location.href = 'index.html';

// Age verification with IRMA
// Age verification with Yivi
if ( window.yivi ) {
console.log("Age verification started");

let yiviCore = yivi.newWeb({
element: '#yivi-web-element',

session: {
url: '',
url: '..',
start: {
url: o => `start_session.php?type=` + sessionStorage.getItem('minage') + 'plus',
},
mapping: {
sessionPtr: pkg => {
return {
yiviqr: pkg.sessionPtr.yiviqr,
u: pkg.sessionPtr.u.replace(/https:\/\/(staging\.)?privacybydesign\.foundation/, "https://$1angrygames.nl")
};
},
},
result: {
url: (o, {sessionPtr, sessionToken}) => `${sessionPtr.u.split('/yivi')[0]}/session/${sessionToken}/result`,
url: (o, {sessionPtr, sessionToken}) => `${sessionPtr.u.split('/irma')[0]}/session/${sessionToken}/result`,
}
},

Expand All @@ -128,7 +120,7 @@
console.log("Session successful!");
console.log("Result:", data);
// Continue to order page if user is 18+
let attr = data.disclosed[0][0].rawvalue.toLowerCase();
let attr = daawvalue.toLowerCase();
if (attr === 'yes' || attr === 'ja') {
setTimeout(() => {
$('#phase-agecheck').hide();
Expand All @@ -145,11 +137,12 @@
let error = function (data) {
console.log("Session failed!");
console.log("Error data:", data);
$('#snackbar-content').html('Er is een fout opgetreden bij de leeftijdsverificatie via IRMA.');
$('#snackbar-content').html('Er is een fout opgetreden bij de leeftijdsverificatie via Yivi.');
$('#snackbar').addClass('show');
};

yiviCore.start().then(success, error);
}

})(jQuery);
ta.disclosed[0][0].r

0 comments on commit ff1699a

Please sign in to comment.