var currentUser = null;
navigator.id.watch({
loggedInUser: currentUser,
onlogin: function(assertion) {
// 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({ /* <-- This example uses jQuery, but you can use whatever you'd like */
type: 'POST',
url: '/_browserid', // This is a URL on your website.
data: {assertion: assertion, audience: window.location.origin},
success: function(res, status, xhr) { console.log("Login succeeded!", res, status, xhr); },
error: function(xhr, status, err) { console.log("Login failure: " + err); }
});
},
onlogout: function() {
// A user has logged out! Here you need to:
// 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: '/_browserid', // This is a URL on your website.
data: {},
success: function(res, status, xhr) { console.log("Logout succeeded!", res, status, xhr); },
error: function(xhr, status, err) { console.log("Logout failure: " + err); }
});
}
});
Login works as advertised. Am I doing something wrong or is this a bug?
When I do a logout to _browserid I get a crash:
This is running a master of 2 days ago, compiled using iriscouch build-couchdb with both browserid and geocouch plugins included.
The code I run is from the persona.org website https://developer.mozilla.org/en-US/docs/Persona/Quick_Setup
Login works as advertised. Am I doing something wrong or is this a bug?