@auth0/angular-jwt
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
@@ -246,3 +246,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
this.headerName = config.headerName || 'Authorization'; | ||
this.authScheme = config.authScheme || 'Bearer '; | ||
this.authScheme = (config.authScheme || config.authScheme === '') ? config.authScheme : 'Bearer '; | ||
this.whitelistedDomains = config.whitelistedDomains || []; | ||
@@ -256,3 +256,6 @@ this.throwNoTokenError = config.throwNoTokenError || false; | ||
requestUrl = new URL(request.url); | ||
return this.whitelistedDomains.indexOf(requestUrl.host) > -1; | ||
return this.whitelistedDomains.findIndex(function (domain) { | ||
return typeof domain === 'string' ? domain === requestUrl.host : | ||
domain instanceof RegExp ? domain.test(requestUrl.host) : false; | ||
}) > -1; | ||
} | ||
@@ -380,2 +383,2 @@ catch (err) { | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAwMzhiMTMxMzQyMmVkMDY1Y2MyZCIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwgXCJAYW5ndWxhci9jb3JlXCIiLCJ3ZWJwYWNrOi8vLy4vc3JjL2p3dG9wdGlvbnMudG9rZW4udHMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2p3dGhlbHBlci5zZXJ2aWNlLnRzIiwid2VicGFjazovLy8uL3NyYy9qd3QuaW50ZXJjZXB0b3IudHMiLCJ3ZWJwYWNrOi8vLy4vaW5kZXgudHMiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIFwiQGFuZ3VsYXIvY29tbW9uL2h0dHBcIiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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G9ydGVkIGluIHlvdXIgYXBwbGljYXRpb25cXCdzIG1haW4gbW9kdWxlLicpO1xuICAgIH1cbiAgfVxuICBzdGF0aWMgZm9yUm9vdChvcHRpb25zOiBKd3RNb2R1bGVPcHRpb25zKTogTW9kdWxlV2l0aFByb3ZpZGVycyB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBKd3RNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAge1xuICAgICAgICAgIHByb3ZpZGU6IEhUVFBfSU5URVJDRVBUT1JTLFxuICAgICAgICAgIHVzZUNsYXNzOiBKd3RJbnRlcmNlcHRvcixcbiAgICAgICAgICBtdWx0aTogdHJ1ZVxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgcHJvdmlkZTogSldUX09QVElPTlMsXG4gICAgICAgICAgdXNlVmFsdWU6IG9wdGlvbnMuY29uZmlnXG4gICAgICAgIH0sXG4gICAgICAgIEp3dEhlbHBlclNlcnZpY2VcbiAgICAgIF1cbiAgICB9O1xuICB9XG59XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9ub2RlX21vZHVsZXMvdHNsaW50LWxvYWRlciEuL2luZGV4LnRzIiwibW9kdWxlLmV4cG9ydHMgPSBfX1dFQlBBQ0tfRVhURVJOQUxfTU9EVUxFXzVfXztcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyBleHRlcm5hbCBcIkBhbmd1bGFyL2NvbW1vbi9odHRwXCJcbi8vIG1vZHVsZSBpZCA9IDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ== |
@@ -10,3 +10,3 @@ import { ModuleWithProviders } from '@angular/core'; | ||
authScheme?: string; | ||
whitelistedDomains?: Array<string>; | ||
whitelistedDomains?: Array<string | RegExp>; | ||
throwNoTokenError?: boolean; | ||
@@ -13,0 +13,0 @@ skipWhenExpired?: boolean; |
{ | ||
"name": "@auth0/angular-jwt", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-beta.7", | ||
"description": "JSON Web Token helper library for Angular", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -9,3 +9,3 @@ import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; | ||
authScheme: string; | ||
whitelistedDomains: Array<string>; | ||
whitelistedDomains: Array<string | RegExp>; | ||
throwNoTokenError: boolean; | ||
@@ -12,0 +12,0 @@ skipWhenExpired: boolean; |
@@ -9,3 +9,3 @@ import { Injectable, Inject } from '@angular/core'; | ||
this.headerName = config.headerName || 'Authorization'; | ||
this.authScheme = config.authScheme || 'Bearer '; | ||
this.authScheme = (config.authScheme || config.authScheme === '') ? config.authScheme : 'Bearer '; | ||
this.whitelistedDomains = config.whitelistedDomains || []; | ||
@@ -19,3 +19,6 @@ this.throwNoTokenError = config.throwNoTokenError || false; | ||
requestUrl = new URL(request.url); | ||
return this.whitelistedDomains.indexOf(requestUrl.host) > -1; | ||
return this.whitelistedDomains.findIndex(function (domain) { | ||
return typeof domain === 'string' ? domain === requestUrl.host : | ||
domain instanceof RegExp ? domain.test(requestUrl.host) : false; | ||
}) > -1; | ||
} | ||
@@ -22,0 +25,0 @@ catch (err) { |
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
69830
755