Skip to content

Commit

Permalink
Merge pull request #17 from privacybydesign/shoulder-surf
Browse files Browse the repository at this point in the history
Migrated from irmajs to irma-frontend
  • Loading branch information
synaptic-cleft authored Jan 13, 2022
2 parents 70f065d + 52b6a04 commit b196d09
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 402 deletions.
2 changes: 1 addition & 1 deletion webapp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cp -r ./fonts ./build/assets/
cp ./style.css ./build/assets/
cp ./common.js ./build/assets/
cp ./node_modules/jquery/dist/jquery.min.js ./build/assets/
cp ./node_modules/@privacybydesign/irmajs/dist/irma.js ./build/assets/
cp ./node_modules/@privacybydesign/irma-frontend/dist/irma.js ./build/assets/
24 changes: 16 additions & 8 deletions webapp/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,21 @@ function issue(jwt, url) {
setStatus('info', MESSAGES['email-add-verified']);
console.log('success: ', jwt);

irma.startSession(config.IRMASERVER, jwt, 'publickey')
.then(function(pkg) {
console.log('session started');
return irma.handleSession(pkg.sessionPtr,
{method: 'popup', language: language}
);
})
irma.newPopup({
url: config.IRMASERVER,
language: language,
session: {
start: {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
body: jwt,
},
result: false,
},
})
.start()
.then(function() {
console.log('session done');
if (url) {
Expand All @@ -112,7 +120,7 @@ function issue(jwt, url) {
})
.catch(function(err) {
console.error('error:', err);
if (err === irma.SessionStatus.Cancelled)
if (err === 'Aborted')
setStatus('info', MESSAGES['email-add-cancel']);
else
setStatus('danger', MESSAGES['email-add-error']);
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "./build.sh"
},
"dependencies": {
"@privacybydesign/irmajs": "^0.2.2",
"@privacybydesign/irma-frontend": "^0.4.3",
"jquery": "^3.4.1"
}
}
Loading

0 comments on commit b196d09

Please sign in to comment.