Skip to content

Commit

Permalink
Merge pull request lloyd#22 from shane-tomlinson/null_assertion_nosignin
Browse files Browse the repository at this point in the history
Only do the login request if assertion !== null closes lloyd#19
  • Loading branch information
lloyd committed Sep 23, 2011
2 parents 766937a + f336669 commit 38d3e55
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38d3e55

Please sign in to comment.