Skip to content

Instantly share code, notes, and snippets.

@scan
Created September 12, 2012 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scan/842c678aa9ff76428069 to your computer and use it in GitHub Desktop.
Save scan/842c678aa9ff76428069 to your computer and use it in GitHub Desktop.
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;
}));
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment