aftermath-ts-sdk 1.2.45-auth.2 → 1.2.45-auth.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,7 @@ class Caller {
|
|
|
24
24
|
if (this.apiBaseUrl === undefined)
|
|
25
25
|
throw new Error("no apiBaseUrl: unable to fetch data");
|
|
26
26
|
// TODO: handle url prefixing and api calls based on network differently
|
|
27
|
-
return `${this.apiBaseUrl}/api/${this.apiUrlPrefix === "" ? "" : this.apiUrlPrefix
|
|
27
|
+
return `${this.apiBaseUrl}/api/${this.apiUrlPrefix === "" ? "" : this.apiUrlPrefix}${url === "" ? "" : `/${url}`}`;
|
|
28
28
|
};
|
|
29
29
|
this.setAccessToken = (accessToken) => {
|
|
30
30
|
this.config.accessToken = accessToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/packages/auth/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAIN,SAAS,EACT,MAAM,aAAa,CAAC;AAGrB,qBAAa,IAAK,SAAQ,MAAM;IAK/B,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,UAAU,CAAS;gBAMf,MAAM,CAAC,EAAE,YAAY;IAQpB,IAAI,CAAC,MAAM,EAAE;QACzB,aAAa,EAAE,UAAU,CAAC;QAC1B,mBAAmB,EAAE,mBAAmB,CAAC;KACzC,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/packages/auth/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAIN,SAAS,EACT,MAAM,aAAa,CAAC;AAGrB,qBAAa,IAAK,SAAQ,MAAM;IAK/B,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,UAAU,CAAS;gBAMf,MAAM,CAAC,EAAE,YAAY;IAQpB,IAAI,CAAC,MAAM,EAAE;QACzB,aAAa,EAAE,UAAU,CAAC;QAC1B,mBAAmB,EAAE,mBAAmB,CAAC;KACzC,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC;IAmCV,mBAAmB,CAAC,MAAM,EAAE;QACxC,aAAa,EAAE,UAAU,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC;IA0EV,sBAAsB,CAAC,MAAM,EAAE;QAC3C,aAAa,EAAE,UAAU,CAAC;QAC1B,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,WAAW,EAAE,MAAM,CAAC;QACpB,oBAAoB,EAAE,UAAU,CAAC;QACjC,UAAU,EAAE,SAAS,EAAE,CAAC;KACxB,GAAG,OAAO,CAAC,OAAO,CAAC;YAqCN,cAAc;IAyB5B,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAcnC"}
|
|
@@ -40,9 +40,7 @@ class Auth extends caller_1.Caller {
|
|
|
40
40
|
this.setAccessToken(accessToken);
|
|
41
41
|
if (this.isCanceled)
|
|
42
42
|
return; // double-check before scheduling next timer
|
|
43
|
-
|
|
44
|
-
// const TIMEOUT_REDUCTION_RATIO = 0.9;
|
|
45
|
-
const TIMEOUT_REDUCTION_RATIO = (1 / 60) * (1 / 6);
|
|
43
|
+
const TIMEOUT_REDUCTION_RATIO = 0.9;
|
|
46
44
|
const interval = (expirationTimestamp - Date.now()) * TIMEOUT_REDUCTION_RATIO;
|
|
47
45
|
// Store the timer so we can cancel it later
|
|
48
46
|
this.refreshTimer = setTimeout(startRefresh, interval);
|