Mercurial > hg > bitsyauth
diff example/persona.html @ 45:54a53bbe5be9
bitsyauth/__init__.py example/persona.html
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 29 Dec 2013 20:20:38 -0800 |
parents | d4522af2c6e5 |
children | d66d6c10cfe4 |
line wrap: on
line diff
--- a/example/persona.html Sat Dec 28 14:26:29 2013 -0800 +++ b/example/persona.html Sun Dec 29 20:20:38 2013 -0800 @@ -22,15 +22,14 @@ // A user has logged in! Here you need to: // 1. Send the assertion to your backend for verification and to create a session. // 2. Update your UI. - $.ajax({ - type: 'POST', - url: '/auth/login', // This is a URL on your website. - data: {assertion: assertion}, - success: function(res, status, xhr) { window.location.reload(); }, - error: function(xhr, status, err) { - navigator.id.logout(); - alert("Login failure: " + err); - } + $.ajax({type: 'POST', + url: '/auth/login', // This is a URL on your website. + data: {assertion: assertion}, + success: function(res, status, xhr) { window.location.reload(); }, + error: function(xhr, status, err) { + navigator.id.logout(); + alert("Login failure: " + err); + } }); }, onlogout: function() { @@ -38,12 +37,12 @@ // Tear down the user's session by redirecting the user or making a call to your backend. // Also, make sure loggedInUser will get set to null on the next page load. // (That's a literal JavaScript null. Not false, 0, or undefined. null.) - $.ajax({ - type: 'POST', - url: '/auth/logout', // This is a URL on your website. - success: function(res, status, xhr) { window.location.reload(); }, - error: function(xhr, status, err) { alert("Logout failure: " + err); } - }); + // $.ajax({ + // type: 'POST', + // url: '/auth/logout', // This is a URL on your website. + // success: function(res, status, xhr) { window.location.reload(); }, + // error: function(xhr, status, err) { alert("Logout failure: " + err); } + // }); } });