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

@auth0/angular-jwt

Package Overview
Dependencies
Maintainers
9
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/angular-jwt - npm Package Compare versions

Comparing version 1.0.0-beta.7 to 1.0.0-beta.8

85

bundles/core.umd.js
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("@angular/core"), require("@angular/common/http"));
module.exports = factory(require("@angular/core"), require("rxjs/Observable"), require("rxjs/add/observable/fromPromise"), require("rxjs/add/operator/mergeMap"), require("@angular/common/http"));
else if(typeof define === 'function' && define.amd)
define(["@angular/core", "@angular/common/http"], factory);
define(["@angular/core", "rxjs/Observable", "rxjs/add/observable/fromPromise", "rxjs/add/operator/mergeMap", "@angular/common/http"], factory);
else if(typeof exports === 'object')
exports["angular-jwt"] = factory(require("@angular/core"), require("@angular/common/http"));
exports["angular-jwt"] = factory(require("@angular/core"), require("rxjs/Observable"), require("rxjs/add/observable/fromPromise"), require("rxjs/add/operator/mergeMap"), require("@angular/common/http"));
else
root["angular-jwt"] = factory(root["@angular/core"], root["@angular/common/http"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_5__) {
root["angular-jwt"] = factory(root["@angular/core"], root["rxjs/Observable"], root["rxjs/add/observable/fromPromise"], root["rxjs/add/operator/mergeMap"], root["@angular/common/http"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -226,2 +226,8 @@ /******/ // The module cache

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__jwtoptions_token__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Observable__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Observable__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_add_observable_fromPromise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_mergeMap__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_mergeMap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rxjs_add_operator_mergeMap__);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -242,2 +248,5 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

var JwtInterceptor = (function () {

@@ -248,3 +257,6 @@ function JwtInterceptor(config, jwtHelper) {

this.headerName = config.headerName || 'Authorization';
this.authScheme = (config.authScheme || config.authScheme === '') ? config.authScheme : 'Bearer ';
this.authScheme =
config.authScheme || config.authScheme === ''
? config.authScheme
: 'Bearer ';
this.whitelistedDomains = config.whitelistedDomains || [];

@@ -258,6 +270,7 @@ this.throwNoTokenError = config.throwNoTokenError || false;

requestUrl = new URL(request.url);
return this.whitelistedDomains.findIndex(function (domain) {
return typeof domain === 'string' ? domain === requestUrl.host :
domain instanceof RegExp ? domain.test(requestUrl.host) : false;
}) > -1;
return (this.whitelistedDomains.findIndex(function (domain) {
return typeof domain === 'string'
? domain === requestUrl.host
: domain instanceof RegExp ? domain.test(requestUrl.host) : false;
}) > -1);
}

@@ -271,4 +284,3 @@ catch (err) {

};
JwtInterceptor.prototype.intercept = function (request, next) {
var token = this.tokenGetter();
JwtInterceptor.prototype.handleInterception = function (token, request, next) {
var tokenIsExpired;

@@ -279,7 +291,5 @@ if (!token && this.throwNoTokenError) {

if (this.skipWhenExpired) {
tokenIsExpired = token ? this.jwtHelper.isTokenExpired() : true;
tokenIsExpired = token ? this.jwtHelper.isTokenExpired(token) : true;
}
if (token &&
tokenIsExpired &&
this.skipWhenExpired) {
if (token && tokenIsExpired && this.skipWhenExpired) {
request = request.clone();

@@ -297,2 +307,14 @@ }

};
JwtInterceptor.prototype.intercept = function (request, next) {
var _this = this;
var token = this.tokenGetter();
if (token instanceof Promise) {
return __WEBPACK_IMPORTED_MODULE_3_rxjs_Observable__["Observable"].fromPromise(token).mergeMap(function (asyncToken) {
return _this.handleInterception(asyncToken, request, next);
});
}
else {
return this.handleInterception(token, request, next);
}
};
return JwtInterceptor;

@@ -319,3 +341,3 @@ }());

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_jwthelper_service__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_common_http__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_common_http__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_common_http___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__angular_common_http__);

@@ -361,6 +383,7 @@ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__src_jwtoptions_token__ = __webpack_require__(1);

},
{
provide: __WEBPACK_IMPORTED_MODULE_4__src_jwtoptions_token__["a" /* JWT_OPTIONS */],
useValue: options.config
},
options.jwtOptionsProvider ||
{
provide: __WEBPACK_IMPORTED_MODULE_4__src_jwtoptions_token__["a" /* JWT_OPTIONS */],
useValue: options.config
},
__WEBPACK_IMPORTED_MODULE_2__src_jwthelper_service__["a" /* JwtHelperService */]

@@ -387,5 +410,23 @@ ]

/***/ }),
/* 6 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_7__;
/***/ }),
/* 8 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_8__;
/***/ })
/******/ ]);
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxZmIwOGIxMTU0MTdhYjY4ZjAzZiIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwgXCJAYW5ndWxhci9jb3JlXCIiLCJ3ZWJwYWNrOi8vLy4vc3JjL2p3dG9wdGlvbnMudG9rZW4udHMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2p3dGhlbHBlci5zZXJ2aWNlLnRzIiwid2VicGFjazovLy8uL3NyYy9qd3QuaW50ZXJjZXB0b3IudHMiLCJ3ZWJwYWNrOi8vLy4vaW5kZXgudHMiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIFwiQGFuZ3VsYXIvY29tbW9uL2h0dHBcIiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTztBQ1ZBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7QUFHQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUF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2VSb290IjoiIn0=

@@ -1,2 +0,2 @@

import { ModuleWithProviders } from '@angular/core';
import { ModuleWithProviders, Provider } from '@angular/core';
export * from './src/jwt.interceptor';

@@ -6,4 +6,5 @@ export * from './src/jwthelper.service';

export interface JwtModuleOptions {
jwtOptionsProvider?: Provider;
config: {
tokenGetter: () => string;
tokenGetter?: () => string | Promise<string>;
headerName?: string;

@@ -10,0 +11,0 @@ authScheme?: string;

@@ -24,6 +24,7 @@ import { NgModule, Optional, SkipSelf } from '@angular/core';

},
{
provide: JWT_OPTIONS,
useValue: options.config
},
options.jwtOptionsProvider ||
{
provide: JWT_OPTIONS,
useValue: options.config
},
JwtHelperService

@@ -30,0 +31,0 @@ ]

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"JwtModuleOptions":{"__symbolic":"interface"},"JwtModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}}]],"parameters":[{"__symbolic":"reference","name":"JwtModule"}]}]},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"JwtModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS"},"useClass":{"__symbolic":"reference","module":"./src/jwt.interceptor","name":"JwtInterceptor"},"multi":true},{"provide":{"__symbolic":"reference","module":"./src/jwtoptions.token","name":"JWT_OPTIONS"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"config"}},{"__symbolic":"reference","module":"./src/jwthelper.service","name":"JwtHelperService"}]}}}}},"exports":[{"from":"./src/jwt.interceptor"},{"from":"./src/jwthelper.service"},{"from":"./src/jwtoptions.token"}]},{"__symbolic":"module","version":1,"metadata":{"JwtModuleOptions":{"__symbolic":"interface"},"JwtModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}}]],"parameters":[{"__symbolic":"reference","name":"JwtModule"}]}]},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"JwtModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS"},"useClass":{"__symbolic":"reference","module":"./src/jwt.interceptor","name":"JwtInterceptor"},"multi":true},{"provide":{"__symbolic":"reference","module":"./src/jwtoptions.token","name":"JWT_OPTIONS"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"config"}},{"__symbolic":"reference","module":"./src/jwthelper.service","name":"JwtHelperService"}]}}}}},"exports":[{"from":"./src/jwt.interceptor"},{"from":"./src/jwthelper.service"},{"from":"./src/jwtoptions.token"}]}]
[{"__symbolic":"module","version":3,"metadata":{"JwtModuleOptions":{"__symbolic":"interface"},"JwtModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}}]],"parameters":[{"__symbolic":"reference","name":"JwtModule"}]}]},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"JwtModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS"},"useClass":{"__symbolic":"reference","module":"./src/jwt.interceptor","name":"JwtInterceptor"},"multi":true},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"jwtOptionsProvider"},"right":{"provide":{"__symbolic":"reference","module":"./src/jwtoptions.token","name":"JWT_OPTIONS"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"config"}}},{"__symbolic":"reference","module":"./src/jwthelper.service","name":"JwtHelperService"}]}}}}},"exports":[{"from":"./src/jwt.interceptor"},{"from":"./src/jwthelper.service"},{"from":"./src/jwtoptions.token"}]},{"__symbolic":"module","version":1,"metadata":{"JwtModuleOptions":{"__symbolic":"interface"},"JwtModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf"}}]],"parameters":[{"__symbolic":"reference","name":"JwtModule"}]}]},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"JwtModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HTTP_INTERCEPTORS"},"useClass":{"__symbolic":"reference","module":"./src/jwt.interceptor","name":"JwtInterceptor"},"multi":true},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"jwtOptionsProvider"},"right":{"provide":{"__symbolic":"reference","module":"./src/jwtoptions.token","name":"JWT_OPTIONS"},"useValue":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"options"},"member":"config"}}},{"__symbolic":"reference","module":"./src/jwthelper.service","name":"JwtHelperService"}]}}}}},"exports":[{"from":"./src/jwt.interceptor"},{"from":"./src/jwthelper.service"},{"from":"./src/jwtoptions.token"}]}]
{
"name": "@auth0/angular-jwt",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"description": "JSON Web Token helper library for Angular",

@@ -5,0 +5,0 @@ "scripts": {

@@ -177,2 +177,75 @@ # @auth0/angular-jwt

## Using a Custom Options Factory Function
In some cases, you may need to provide a custom factory function to properly handle your configuration options. This is the case if your `tokenGetter` function relies on a service or if you are using an asynchronous storage mechanism (like Ionic's `Storage`).
Import the `JWT_OPTIONS` `InjectionToken` so that you can instruct it to use your custom factory function.
Create a factory function and specify the options as you normally would if you were using `JwtModule.forRoot` directly. If you need to use a service in the function, list it as a parameter in the function and pass it in the `deps` array when you provide the function.
```ts
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
import { TokenService } from './app.tokenservice';
// ...
export function jwtOptionsFactory(tokenService) {
return {
tokenGetter: () => {
return tokenService.getAsyncToken();
}
}
}
// ...
@NgModule({
// ...
imports: [
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [TokenService]
}
})
],
providers: [TokenService]
})
```
## Configuration for Ionic 2+
The custom factory function approach described above can be used to get a token asynchronously with Ionic's `Storage`.
```ts
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
import { Storage } from '@ionic/storage';
const storage = new Storage();
export function jwtOptionsFactory() {
return {
tokenGetter: () => {
return storage.get('access_token');
}
}
}
// ...
@NgModule({
// ...
imports: [
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory
}
})
]
})
```
## What is Auth0?

@@ -179,0 +252,0 @@

import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
import { JwtHelperService } from './jwthelper.service';
import { Observable } from 'rxjs/Observable';
import { JwtHelperService } from './jwthelper.service';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/operator/mergeMap';
export declare class JwtInterceptor implements HttpInterceptor {
jwtHelper: JwtHelperService;
tokenGetter: () => string;
tokenGetter: () => string | Promise<string>;
headerName: string;

@@ -14,3 +16,4 @@ authScheme: string;

isWhitelistedDomain(request: HttpRequest<any>): boolean;
handleInterception(token: string, request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
}
import { Injectable, Inject } from '@angular/core';
import { JwtHelperService } from './jwthelper.service';
import { JWT_OPTIONS } from './jwtoptions.token';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/operator/mergeMap';
var JwtInterceptor = (function () {

@@ -9,3 +12,6 @@ function JwtInterceptor(config, jwtHelper) {

this.headerName = config.headerName || 'Authorization';
this.authScheme = (config.authScheme || config.authScheme === '') ? config.authScheme : 'Bearer ';
this.authScheme =
config.authScheme || config.authScheme === ''
? config.authScheme
: 'Bearer ';
this.whitelistedDomains = config.whitelistedDomains || [];

@@ -19,6 +25,7 @@ this.throwNoTokenError = config.throwNoTokenError || false;

requestUrl = new URL(request.url);
return this.whitelistedDomains.findIndex(function (domain) {
return typeof domain === 'string' ? domain === requestUrl.host :
domain instanceof RegExp ? domain.test(requestUrl.host) : false;
}) > -1;
return (this.whitelistedDomains.findIndex(function (domain) {
return typeof domain === 'string'
? domain === requestUrl.host
: domain instanceof RegExp ? domain.test(requestUrl.host) : false;
}) > -1);
}

@@ -32,4 +39,3 @@ catch (err) {

};
JwtInterceptor.prototype.intercept = function (request, next) {
var token = this.tokenGetter();
JwtInterceptor.prototype.handleInterception = function (token, request, next) {
var tokenIsExpired;

@@ -40,7 +46,5 @@ if (!token && this.throwNoTokenError) {

if (this.skipWhenExpired) {
tokenIsExpired = token ? this.jwtHelper.isTokenExpired() : true;
tokenIsExpired = token ? this.jwtHelper.isTokenExpired(token) : true;
}
if (token &&
tokenIsExpired &&
this.skipWhenExpired) {
if (token && tokenIsExpired && this.skipWhenExpired) {
request = request.clone();

@@ -58,2 +62,14 @@ }

};
JwtInterceptor.prototype.intercept = function (request, next) {
var _this = this;
var token = this.tokenGetter();
if (token instanceof Promise) {
return Observable.fromPromise(token).mergeMap(function (asyncToken) {
return _this.handleInterception(asyncToken, request, next);
});
}
else {
return this.handleInterception(token, request, next);
}
};
return JwtInterceptor;

@@ -60,0 +76,0 @@ }());

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"JwtInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./jwtoptions.token","name":"JWT_OPTIONS"}]}],null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./jwthelper.service","name":"JwtHelperService"}]}],"isWhitelistedDomain":[{"__symbolic":"method"}],"intercept":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"JwtInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./jwtoptions.token","name":"JWT_OPTIONS"}]}],null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./jwthelper.service","name":"JwtHelperService"}]}],"isWhitelistedDomain":[{"__symbolic":"method"}],"intercept":[{"__symbolic":"method"}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"JwtInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./jwtoptions.token","name":"JWT_OPTIONS"}]}],null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./jwthelper.service","name":"JwtHelperService"}]}],"isWhitelistedDomain":[{"__symbolic":"method"}],"handleInterception":[{"__symbolic":"method"}],"intercept":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"JwtInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"./jwtoptions.token","name":"JWT_OPTIONS"}]}],null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./jwthelper.service","name":"JwtHelperService"}]}],"isWhitelistedDomain":[{"__symbolic":"method"}],"handleInterception":[{"__symbolic":"method"}],"intercept":[{"__symbolic":"method"}]}}}}]
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