Permalink
Browse files

Merge pull request lloyd#22 from shane-tomlinson/null_assertion_nosignin

Only do the login request if assertion !== null closes lloyd#19
  • Loading branch information...
lloyd committed Sep 23, 2011
2 parents 766937a + f336669 commit 38d3e55464714c4af96b70aee3dcddde4556b779
Showing with 17 additions and 12 deletions.
  1. +17 −12 static/js/main.js
View
@@ -96,18 +96,23 @@ function loggedOut() {
// browserid dialog
function gotVerifiedEmail(assertion) {
// got an assertion, now send it up to the server for verification
$.ajax({
type: 'POST',
url: '/api/login',
data: { assertion: assertion },
success: function(res, status, xhr) {
if (res === null) loggedOut();
else loggedIn(res);
},
error: function(res, status, xhr) {
alert("login failure" + res);
}
});
if (assertion !== null) {
$.ajax({
type: 'POST',
url: '/api/login',
data: { assertion: assertion },
success: function(res, status, xhr) {
if (res === null) loggedOut();
else loggedIn(res);
},
error: function(res, status, xhr) {
alert("login failure" + res);
}
});
}
else {
loggedOut();
}
}
// For some reason, login/logout do not respond when bound using jQuery

0 comments on commit 38d3e55

Please sign in to comment.