angular2-jwt
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -30,3 +30,3 @@ "use strict"; | ||
}()); | ||
AuthConfigConsts.DEFAULT_TOKEN_NAME = 'access_token'; | ||
AuthConfigConsts.DEFAULT_TOKEN_NAME = 'token'; | ||
AuthConfigConsts.DEFAULT_HEADER_NAME = 'Authorization'; | ||
@@ -33,0 +33,0 @@ AuthConfigConsts.HEADER_PREFIX_BEARER = 'Bearer '; |
{ | ||
"name": "angular2-jwt", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Helper library for handling JWTs in Angular 2+", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -120,3 +120,3 @@ # angular2-jwt | ||
* Header Prefix: `Bearer` | ||
* Token Name: `access_token` | ||
* Token Name: `token` | ||
* Token Getter Function: `(() => localStorage.getItem(tokenName))` | ||
@@ -185,3 +185,3 @@ * Supress error and continue with regular HTTP request if no JWT is saved: `false` | ||
globalHeaders: [{'Accept': 'application/json'}], | ||
tokenGetter: (() => storage.get('access_token')), | ||
tokenGetter: (() => storage.get('token')), | ||
}), http); | ||
@@ -263,3 +263,3 @@ } | ||
useJwtHelper() { | ||
var token = localStorage.getItem('access_token'); | ||
var token = localStorage.getItem('token'); | ||
@@ -279,3 +279,3 @@ console.log( | ||
> **Note:** `tokenNotExpired` will by default assume the token name is `access_token` unless a token name is passed to it, ex: `tokenNotExpired('token_name')`. This will be changed in a future release to automatically use the token name that is set in `AuthConfig`. | ||
> **Note:** `tokenNotExpired` will by default assume the token name is `token` unless a token name is passed to it, ex: `tokenNotExpired('token_name')`. This will be changed in a future release to automatically use the token name that is set in `AuthConfig`. | ||
@@ -282,0 +282,0 @@ ```ts |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44714
3627