secret
Created

  • Download Gist
generated.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
navigator.id.watch({
'loggedInEmail': "null",
'onlogin': (function (jmId_1_0) {
$.ajax({
'data': {
'assertion': jmId_1_0
},
'error': (function (jmId_1_1, jmId_1_2, jmId_1_3) {
alert(("login failure" + jmId_1_1));
}),
'success': (function (jmId_1_4, jmId_1_5, jmId_1_6) {
console.log(jmId_1_4);
}),
'type': "POST",
'url': "\/login"
});
}),
'onlogout': (function () {
$.ajax({
'error': (function (jmId_1_7, jmId_1_8, jmId_1_9) {
alert(("logout failure" + jmId_1_7));
}),
'success': (function (jmId_1_10, jmId_1_11, jmId_1_12) {
window.location.reload();
}),
'type': "POST",
'url': "\/logout"
});
})
});
$((function () {
$("#loginBtn").click((function (jmId_1_13) {
jmId_1_13.preventDefault();
navigator.id.request();
return false;
}));
}));

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.