angular-persona is a collection of services and directives to make easy the integration with Mozilla Persona.
To use angular-persona you have to:
install angular-persona with bower:
bower install angular-persona
index.html, after the persona library, include the angular-persona file
In your module declaration you have to include the persona module
The configuration is very similar to Vanilla Persona: https://developer.mozilla.org/en-US/Persona/Quick_setup
You have to setup a login handler and a logout handler. You should do it in the run phase, in order to be able to use $http, if necessary.
In this example we suppose you store your user in a user service (it's the sensible thing to do). Remember, if the user is logged out, user.email should be null.
To allow the user to login you should create a login button, and call Persona.request when it's clicked:
Remember to install all dependencies:
To launch tests simply run