Skip to content

auth for angualr request and emit response status to rootscope

Notifications You must be signed in to change notification settings

greengerong/green-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

green-auth Build Status

Auth for angular and broadcast response status from rootscope.


Run Test: grunt

Run demo server: grunt server

All of this, please make sure you install node and grunt-cli(npm install -g grunt-cli) and run npm intsall, bower install on project directory.

You can download from dist or bower install:

bower install green-auth --save

note: If you want to keep the token when user refresh the page, you put one of storage :

    angular.module("green.auth.demo", ["green.auth", "ngCookies"])
	.config(["tokenCacheFactory", "authServiceProvider",
		function(tokenCacheFactory, authServiceProvider) {
	      //TODO: you can define your token cache. default is in js object.
	      //tokenCacheFactory inlcude : jsObject, localStorage, sessionStorage, cookie
	      authServiceProvider.setCacheFactory(tokenCacheFactory.cookie("my-customer-stroage-token-key"));
		}
	]);

If you want to use cookie cache factory, make sure include angular-cookies and module depend on ngCookie module.

About

auth for angualr request and emit response status to rootscope

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages