Created
May 7, 2015 15:41
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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