This angular module is an abstraction of the nereid service. If you are writing an angular web application that talks to Nereid, the basic authentication can be performed using this module. Additional service could be built using the support features.
This module requires that the Nereid version should atleast be 3.0.4.0
- Service for nereid authentication.
- Directive
show-if-auth
andhide-if-auth
for showing and hiding DOM based on authentication.
http://openlabs.github.io/angular-nereid/
- required: angular-base64
See bower.json
and index.html
in the gh-pages
branch for a full list / more details
- download the files using bower
- add
"angular-nereid": "latest"
to yourbower.json
file then runbower install
- OR run
bower install angular-nereid
- include the files in your app
nereid.min.js
- include the module in angular (i.e. in
app.js
) -openlabs.angular-nereid
See the gh-pages
branch, files bower.json
and index.html
for a full example.
The module also broadcasts the following three events:
nereid-auth:login
: When the login is successful (after the token is set). The data returned by the server on successful login is provided as argument.nereid-auth:loginFailed
: Broadcasted when the login fails. Theresponse
,status
andheaders
are sent in an object as argument.nereid-auth:logout
: Broadcasted when the user is logged out. Remember that logout could be triggered by the expiry of token too.nereid-auth:loginRequired
: Broadcasted when a request sent to the server fails with 401. This is usually indicative of a wrong token or the absence of a valid login, which is required to access the resource.
See the nereid.js
file top comments for usage examples and documentation
https://github.com/openlabs/angular-nereid/blob/master/nereid.js
git checkout gh-pages
- run
npm install && bower install
- write your code then run
grunt
- git commit your changes
- run
- copy over core files (.js and .css/.less for directives) to master branch
git checkout master
git checkout gh-pages nereid.js nereid.min.js
- update README, CHANGELOG, bower.json, and do any other final polishing to prepare for publishing
- git commit changes
- git tag with the version number, i.e.
git tag v1.0.0
- create github repo and push
- [if remote does not already exist or is incorrect]
git remote add origin [github url]
git push origin master --tags
(want to push master branch first so it is the default on github)git checkout gh-pages
git push origin gh-pages
- [if remote does not already exist or is incorrect]
- (optional) register bower component
bower register angular-nereid [git repo url]
Install git pre-commit hook:
cp .hooks/pre-commit.sh .git/hooks/pre-commit