# angular-jwt-auth-module

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

Latest version **0.0.13** (published 2018-09-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install angular-jwt-auth-module
pnpm add angular-jwt-auth-module
yarn add angular-jwt-auth-module
bun add angular-jwt-auth-module
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2018-09-11 |
| First published | 2018-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 40 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | azzra |
| Maintainers | thibautjudepj |
| Keywords | angularjs, jwt, auth |

## Links

- npm: https://www.npmjs.com/package/angular-jwt-auth-module
- Repository: https://github.com/purjus/angular-jwt-auth-module
- Homepage: https://github.com/purjus/angular-jwt-auth-module#readme
- Issues: https://github.com/purjus/angular-jwt-auth-module/issues
- npm.io page: https://npm.io/package/angular-jwt-auth-module

## Dependencies (4)

- [angular-jwt](https://npm.io/package/angular-jwt.md) ^0.1.9
- [angular-http-auth](https://npm.io/package/angular-http-auth.md) ^1.3.0
- [angular-ws-service](https://npm.io/package/angular-ws-service.md) ^0.0.4
- [angular-local-storage](https://npm.io/package/angular-local-storage.md) ^0.2.7

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 0.0.13 (latest) — 2018-09-11
- 0.0.12 — 2018-09-11
- 0.0.11 — 2018-09-11
- 0.0.10 — 2018-09-11
- 0.0.9 — 2018-09-11
- 0.0.8 — 2018-09-11
- 0.0.7 — 2018-09-11
- 0.0.6 — 2018-09-11
- 0.0.5 — 2018-09-11
- 0.0.4 — 2018-09-11
- 0.0.3 — 2018-09-11

## README

# angular-jwt-auth-module
Mix [auth0/angular-jwt](https://github.com/auth0/angular-jwt) & [witoldsz/angular-http-auth](https://github.com/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

```sh
npm i angular-jwt-auth-module
```

### Build

```sh
gulp build
```

### Set the login_check URL

```js
angular.module('app', ['...', 'angular-jwt-auth-module', 'http-auth-interceptor'])....
```

```js
// app.js
.config(function(angularJwtAuthToolsProvider) {
  angularJwtAuthToolsProvider.urlLoginCheck = '/login_check';
})
```

### Custom methods

You can override the `angularJwtAuthTools` methods.

```js
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);
  }];

});
```

---
_Source: https://npm.io/package/angular-jwt-auth-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
