@servicetitan/ajax-handlers
Advanced tools
Comparing version
import { AxiosRequestConfig } from 'axios'; | ||
import { AuthAdapter } from './auth-adapter'; | ||
import { WithMicroserviceContext } from '../with-microservice'; | ||
interface BearerTokenAuthOptions { | ||
authURL?: string; | ||
export interface BearerTokenAuthOptions { | ||
} | ||
@@ -12,3 +11,3 @@ export declare class BearerTokenAuth implements AuthAdapter { | ||
private axios; | ||
constructor(context: WithMicroserviceContext, options?: BearerTokenAuthOptions); | ||
constructor(context: WithMicroserviceContext, _options?: BearerTokenAuthOptions); | ||
onDestroy(): void; | ||
@@ -23,3 +22,2 @@ authenticate(): Promise<void>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=bearer-token-auth.d.ts.map |
import axios from 'axios'; | ||
export class BearerTokenAuth { | ||
constructor(context, options = {}) { | ||
var _a, _b; | ||
constructor(context, _options = {}) { | ||
var _a; | ||
Object.defineProperty(this, "authAbortController", { | ||
@@ -29,3 +29,3 @@ enumerable: true, | ||
}); | ||
this.authURL = (_b = (_a = options.authURL) !== null && _a !== void 0 ? _a : context.authURL) !== null && _b !== void 0 ? _b : `${context.baseURL}/auth`; | ||
this.authURL = (_a = context.authURL) !== null && _a !== void 0 ? _a : `${context.baseURL}/auth`; | ||
this.axios = axios.create(); | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "@servicetitan/ajax-handlers", | ||
"version": "28.4.0", | ||
"version": "28.5.0", | ||
"description": "", | ||
@@ -21,3 +21,3 @@ "repository": { | ||
"devDependencies": { | ||
"@servicetitan/react-ioc": "28.4.0", | ||
"@servicetitan/react-ioc": "28.5.0", | ||
"@testing-library/dom": "^10.4.0", | ||
@@ -33,3 +33,3 @@ "@testing-library/jest-dom": "^6.6.3", | ||
"peerDependencies": { | ||
"@servicetitan/react-ioc": "28.4.0", | ||
"@servicetitan/react-ioc": "28.5.0", | ||
"axios": "~0.28.1", | ||
@@ -44,3 +44,3 @@ "react": ">=17.0.2" | ||
}, | ||
"gitHead": "051b5b2f70ae6be345aa08ffdd49d8c049272940" | ||
"gitHead": "580ace3d4bce0472e985b1d4eb5e98e0be625f1d" | ||
} |
@@ -5,5 +5,3 @@ import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
interface BearerTokenAuthOptions { | ||
authURL?: string; | ||
} | ||
export interface BearerTokenAuthOptions {} | ||
@@ -16,4 +14,4 @@ export class BearerTokenAuth implements AuthAdapter { | ||
constructor(context: WithMicroserviceContext, options: BearerTokenAuthOptions = {}) { | ||
this.authURL = options.authURL ?? context.authURL ?? `${context.baseURL}/auth`; | ||
constructor(context: WithMicroserviceContext, _options: BearerTokenAuthOptions = {}) { | ||
this.authURL = context.authURL ?? `${context.baseURL}/auth`; | ||
this.axios = axios.create(); | ||
@@ -20,0 +18,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
181835
-0.09%3503
-0.11%