yocto-angular-jwt

1.1.5 • Public • Published

+NPM

Code Climate Test Coverage Issue Count Build Status

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
  1. First include our dist file in your html header
  2. Include in your angular apps our services yocto-angular-jwt like :
angular.module('YOUR-APP', [ 'yocto-angular-jwt' ]);
// Your code
  1. 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.

Package Sidebar

Install

npm i yocto-angular-jwt

Weekly Downloads

0

Version

1.1.5

License

Apache-2.0

Last publish

Collaborators

  • cbalard-y8
  • yocto