yocto-angular-jwt
v1.1.5
Published
An angular utility service to manage access token based on jwt for yocto-jwt node package
Downloads
5
Readme
Overview
This module provide an utility tools for manage access token based on jwt if you use yocto-jwt npm package on our serveur.
Motivation
We designed and wrote this module to have a front-end tools that can manage automatically our jwt token process build with yocto-jwt package.
How it works ?
For each http request an access token was sent with each request.
If you don't have a valid access token your access will be rejected.
The access token was refresh from the server each time your set in refreshToken
property config.
For more details about this access token please read yocto-jwt README
How to use
bower install --save yocto-angularjwt
- First include our dist file in your html header
- Include in your angular apps our services
yocto-angular-jwt
like :
angular.module('YOUR-APP', [ 'yocto-angular-jwt' ]);
// Your code
- Set your refresh token url and the associated delay like this :
angular.module('YOUR-APP', [ 'yocto-angular-jwt' ])
.config(['jwtConstantProvider', function (jwtConstantProvider) {
jwtConstantProvider.set({ refreshToken : 30000, refreshUrl : 'YOUR-URL', autoStart : true });
}])
IMPORTANT
Is you are using yocto-angular-jwt
without yocto-jwt you must unstringify.