Comparing version 4.0.0 to 4.0.1
@@ -16,3 +16,4 @@ import { ClientOptions } from '../lib/runtime.js'; | ||
clientAssertionSigningKey: string; | ||
clientAssertionSigningAlg?: string; | ||
} | ||
export type ManagementClientOptionsWithClientCredentials = ManagementClientOptionsWithClientSecret | ManagementClientOptionsWithClientAssertion; |
@@ -15,4 +15,3 @@ "use strict"; | ||
this.tokenProvider = new token_provider_js_1.TokenProvider({ | ||
clientId: options.clientId, | ||
domain: options.domain, | ||
...options, | ||
audience: (_a = options.audience) !== null && _a !== void 0 ? _a : `https://${options.domain}/api/v2/`, | ||
@@ -19,0 +18,0 @@ ...{ clientSecret: options.clientSecret }, |
@@ -1,7 +0,2 @@ | ||
interface BaseOptions { | ||
domain: string; | ||
audience: string; | ||
clientId: string; | ||
enableCache?: boolean; | ||
} | ||
import { ManagementClientOptionsWithClientAssertion, ManagementClientOptionsWithClientSecret } from './management-client-options.js'; | ||
export declare class TokenProvider { | ||
@@ -13,10 +8,9 @@ private options; | ||
private pending; | ||
constructor(options: BaseOptions & { | ||
clientSecret: string; | ||
constructor(options: ManagementClientOptionsWithClientSecret & { | ||
audience: string; | ||
}); | ||
constructor(options: BaseOptions & { | ||
clientAssertionSigningKey: string; | ||
constructor(options: ManagementClientOptionsWithClientAssertion & { | ||
audience: string; | ||
}); | ||
getAccessToken(): Promise<string>; | ||
} | ||
export {}; |
@@ -11,14 +11,8 @@ "use strict"; | ||
this.accessToken = ''; | ||
this.authenticationClient = new index_js_1.AuthenticationClient({ | ||
clientId: options.clientId, | ||
domain: options.domain, | ||
clientSecret: options.clientSecret, | ||
clientAssertionSigningKey: options.clientAssertionSigningKey, | ||
}); | ||
this.authenticationClient = new index_js_1.AuthenticationClient(options); | ||
} | ||
async getAccessToken() { | ||
const disableCache = this.options.enableCache === false; | ||
if (disableCache || !this.accessToken || Date.now() > this.expiresAt - LEEWAY) { | ||
if (!this.accessToken || Date.now() > this.expiresAt - LEEWAY) { | ||
this.pending = | ||
(!disableCache && this.pending) || | ||
this.pending || | ||
this.authenticationClient.oauth.clientCredentialsGrant({ | ||
@@ -25,0 +19,0 @@ audience: this.options.audience, |
@@ -1,1 +0,1 @@ | ||
export declare const version = "4.0.0"; | ||
export declare const version = "4.0.1"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '4.0.0'; | ||
exports.version = '4.0.1'; | ||
//# sourceMappingURL=version.js.map |
@@ -16,3 +16,4 @@ import { ClientOptions } from '../lib/runtime.js'; | ||
clientAssertionSigningKey: string; | ||
clientAssertionSigningAlg?: string; | ||
} | ||
export type ManagementClientOptionsWithClientCredentials = ManagementClientOptionsWithClientSecret | ManagementClientOptionsWithClientAssertion; |
@@ -12,4 +12,3 @@ import { TokenProvider } from './token-provider.js'; | ||
this.tokenProvider = new TokenProvider({ | ||
clientId: options.clientId, | ||
domain: options.domain, | ||
...options, | ||
audience: (_a = options.audience) !== null && _a !== void 0 ? _a : `https://${options.domain}/api/v2/`, | ||
@@ -16,0 +15,0 @@ ...{ clientSecret: options.clientSecret }, |
@@ -1,7 +0,2 @@ | ||
interface BaseOptions { | ||
domain: string; | ||
audience: string; | ||
clientId: string; | ||
enableCache?: boolean; | ||
} | ||
import { ManagementClientOptionsWithClientAssertion, ManagementClientOptionsWithClientSecret } from './management-client-options.js'; | ||
export declare class TokenProvider { | ||
@@ -13,10 +8,9 @@ private options; | ||
private pending; | ||
constructor(options: BaseOptions & { | ||
clientSecret: string; | ||
constructor(options: ManagementClientOptionsWithClientSecret & { | ||
audience: string; | ||
}); | ||
constructor(options: BaseOptions & { | ||
clientAssertionSigningKey: string; | ||
constructor(options: ManagementClientOptionsWithClientAssertion & { | ||
audience: string; | ||
}); | ||
getAccessToken(): Promise<string>; | ||
} | ||
export {}; |
@@ -8,14 +8,8 @@ import { AuthenticationClient } from '../auth/index.js'; | ||
this.accessToken = ''; | ||
this.authenticationClient = new AuthenticationClient({ | ||
clientId: options.clientId, | ||
domain: options.domain, | ||
clientSecret: options.clientSecret, | ||
clientAssertionSigningKey: options.clientAssertionSigningKey, | ||
}); | ||
this.authenticationClient = new AuthenticationClient(options); | ||
} | ||
async getAccessToken() { | ||
const disableCache = this.options.enableCache === false; | ||
if (disableCache || !this.accessToken || Date.now() > this.expiresAt - LEEWAY) { | ||
if (!this.accessToken || Date.now() > this.expiresAt - LEEWAY) { | ||
this.pending = | ||
(!disableCache && this.pending) || | ||
this.pending || | ||
this.authenticationClient.oauth.clientCredentialsGrant({ | ||
@@ -22,0 +16,0 @@ audience: this.options.audience, |
@@ -1,1 +0,1 @@ | ||
export declare const version = "4.0.0"; | ||
export declare const version = "4.0.1"; |
@@ -1,2 +0,2 @@ | ||
export const version = '4.0.0'; | ||
export const version = '4.0.1'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "auth0", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "SDK for Auth0 API v2", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2065505
52853