Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-jwt

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-jwt - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

LICENSE

2

angular2-jwt.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc