Skip to content

Instantly share code, notes, and snippets.

@clarkbw
Created May 7, 2015 15:41
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 clarkbw/8f2670d612d9abc39556 to your computer and use it in GitHub Desktop.
Save clarkbw/8f2670d612d9abc39556 to your computer and use it in GitHub Desktop.
firefox account code to check if a user is logged in, used within the browser
Cu.import("resource://gre/modules/FxAccounts.jsm");
fxAccounts.getSignedInUser().then((data) => {
if (data !== null && data.email) {
console.log('logged in with email', data.email);
// logged in
} else {
// not logged in
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment