hevy-shared 1.0.821 → 1.0.822
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.
package/built/API/APIClient.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface HevyAPIClientConfig {
|
|
|
83
83
|
*
|
|
84
84
|
* @default {undefined}
|
|
85
85
|
*/
|
|
86
|
-
localRefresh?(): ClientAuthToken;
|
|
86
|
+
localRefresh?(): ClientAuthToken | null;
|
|
87
87
|
}
|
|
88
88
|
export declare class HevyAPIClient {
|
|
89
89
|
private static readonly DEFAULT_TOKEN_EXPIRY_SAFETY_THRESHOLD_MS;
|
package/built/API/APIClient.js
CHANGED
|
@@ -60,6 +60,10 @@ class HevyAPIClient {
|
|
|
60
60
|
const authToken = this._config.localRefresh();
|
|
61
61
|
this._authToken = authToken;
|
|
62
62
|
this._lastTokenRefresh = undefined; // This isn't shared across processes
|
|
63
|
+
if (authToken === null) {
|
|
64
|
+
// We were de-authenticated, there is nothing to refresh.
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
63
67
|
if (!this._isExpired({ now, authToken })) {
|
|
64
68
|
// Token was refreshed by a different process (e.g. other browser tab).
|
|
65
69
|
return;
|