0.0.13 • Published 6 years ago

angular-jwt-auth-module v0.0.13

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

angular-jwt-auth-module

Mix auth0/angular-jwt & witoldsz/angular-http-auth to get automatic auth when response code is 401.

DEPRECATED as it's only compatible with AngularJS

NO TESTS


Documentation

Installation

npm i angular-jwt-auth-module

Build

gulp build

Set the login_check URL

angular.module('app', ['...', 'angular-jwt-auth-module', 'http-auth-interceptor'])....
// app.js
.config(function(angularJwtAuthToolsProvider) {
  angularJwtAuthToolsProvider.urlLoginCheck = '/login_check';
})

Custom methods

You can override the angularJwtAuthTools methods.

angular.module('angular-jwt-auth-module', ['angular-jwt', 'angular-jwt-auth-module.tools', 'LocalStorageModule'])
.config(function($httpProvider, jwtInterceptorProvider, angularJwtAuthToolsProvider) {

  // Please note we're annotating the function so that the $injector works when the file is minified
  angularJwtAuthToolsProvider.saveToken = ['localStorageService', function(localStorageService) {
     // "this" is set by $injector, https://docs.angularjs.org/api/auto/service/$injector
    localStorageService.set('auth.jwt_token', this);
  }];

});
0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago