angular2-jwt
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -21,3 +21,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.headerName = this.config.headerName || 'Authorization'; | ||
this.headerPrefix = this.config.headerPrefix || 'Bearer '; | ||
this.headerPrefix = this.config.headerPrefix + ' ' || 'Bearer '; | ||
this.tokenName = this.config.tokenName || 'id_token'; | ||
@@ -24,0 +24,0 @@ this.noJwtError = this.config.noJwtError || false; |
@@ -32,3 +32,3 @@ import {Injectable, Injector} from 'angular2/core'; | ||
this.headerName = this.config.headerName || 'Authorization'; | ||
this.headerPrefix = this.config.headerPrefix || 'Bearer '; | ||
this.headerPrefix = this.config.headerPrefix + ' ' || 'Bearer '; | ||
this.tokenName = this.config.tokenName || 'id_token'; | ||
@@ -227,2 +227,2 @@ this.noJwtError = this.config.noJwtError || false; | ||
} | ||
} | ||
} |
{ | ||
"name": "angular2-jwt", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Helper library for handling JWTs in Angular 2", | ||
@@ -28,3 +28,3 @@ "repository": { | ||
"dependencies": { | ||
"angular2": "2.0.0-beta.0", | ||
"angular2": ">=2.0.0-beta.0", | ||
"zone.js": "^0.5.10", | ||
@@ -31,0 +31,0 @@ "rxjs": "5.0.0-beta.0" |
@@ -35,3 +35,3 @@ # angular2-jwt | ||
class App { | ||
thing: string; | ||
@@ -85,3 +85,3 @@ | ||
tokenGetter: YOUR_TOKEN_GETTER_FUNCTION, | ||
noJwtError: true | ||
noJwtError: true | ||
}) | ||
@@ -103,3 +103,3 @@ }}), | ||
myHeader.append('Content-Type', 'application/json'); | ||
this.authHttp.get('http://example.com/api/thing', { headers: myHeader} ) | ||
@@ -111,3 +111,3 @@ .subscribe( | ||
); | ||
// Pass it after the body in a POST request | ||
@@ -121,3 +121,3 @@ this.authHttp.post('http://example.com/api/thing', 'post body', { headers: myHeader} ) | ||
} | ||
``` | ||
``` | ||
@@ -162,3 +162,3 @@ ### Using the Observable Token Stream | ||
var token = localStorage.getItem('id_token'); | ||
console.log( | ||
@@ -176,3 +176,3 @@ this.jwtHelper.decodeToken(token), | ||
The `tokenNotExpired` function can be used to check whether a JWT exists in local storage, and if it does, whether it has expired or not. If the token is valid, `tokenNotExpired` returns `true`, otherwise it returns `false`. | ||
The `tokenNotExpired` function can be used to check whether a JWT exists in local storage, and if it does, whether it has expired or not. If the token is valid, `tokenNotExpired` returns `true`, otherwise it returns `false`. | ||
@@ -224,10 +224,12 @@ The router's `@CanActivate` lifecycle hook can be used with `tokenNotExpired` to determine if a route should be accessible. This lifecycle hook is run before the component class instantiates. If `@CanActivate` receives `true`, the router will allow navigation, and if it receives `false`, it won't. | ||
## Issue Reporting | ||
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. | ||
## Author | ||
[Auth0](https://auth0.com) | ||
[Auth0](auth0.com) | ||
## License | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE.txt) file for more info. | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. |
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
32429
3806
432
228
+ Addedangular2@2.0.0-beta.21(transitive)
+ Addedes6-shim@0.35.8(transitive)
+ Addedzone.js@0.6.26(transitive)
- Removedangular2@2.0.0-beta.0(transitive)
- Removedes6-shim@0.33.13(transitive)
- Removedzone.js@0.5.10(transitive)
Updatedangular2@>=2.0.0-beta.0