@supabase/gotrue-js 2.108.1 → 2.108.2-canary.0
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/dist/main/GoTrueClient.d.ts +19 -0
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +97 -8
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/constants.d.ts +8 -0
- package/dist/main/lib/constants.d.ts.map +1 -1
- package/dist/main/lib/constants.js +9 -1
- package/dist/main/lib/constants.js.map +1 -1
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +5 -3
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.d.ts.map +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/lib/version.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts +19 -0
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +98 -9
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/constants.d.ts +8 -0
- package/dist/module/lib/constants.d.ts.map +1 -1
- package/dist/module/lib/constants.js +8 -0
- package/dist/module/lib/constants.js.map +1 -1
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js +5 -3
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.d.ts.map +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/lib/version.js.map +1 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/GoTrueClient.ts +116 -13
- package/src/lib/constants.ts +9 -0
- package/src/lib/fetch.ts +5 -3
- package/src/lib/version.ts +1 -1
|
@@ -59,6 +59,25 @@ export default class GoTrueClient {
|
|
|
59
59
|
protected autoRefreshTickTimeout: ReturnType<typeof setTimeout> | null;
|
|
60
60
|
protected visibilityChangedCallback: (() => Promise<any>) | null;
|
|
61
61
|
protected refreshingDeferred: Deferred<CallRefreshTokenResult> | null;
|
|
62
|
+
/**
|
|
63
|
+
* Cache of the most recent refresh failure, keyed by the refresh token
|
|
64
|
+
* that failed. Serial callers passing the *same* token within
|
|
65
|
+
* `REFRESH_FAILURE_COOLDOWN_MS` (including subsequent auto-refresh ticks)
|
|
66
|
+
* receive this cached result instead of firing another `/token` request.
|
|
67
|
+
* Callers passing a *different* token (token rotation pickup, explicit
|
|
68
|
+
* `setSession`/`refreshSession({ refresh_token })`, multi-account switch)
|
|
69
|
+
* bypass the cache and attempt a fresh refresh as they should.
|
|
70
|
+
* Cleared on any successful refresh (locally or via BroadcastChannel from
|
|
71
|
+
* another tab) and on `_removeSession`.
|
|
72
|
+
*
|
|
73
|
+
* Pairs with `refreshingDeferred`: concurrent callers share the in-flight
|
|
74
|
+
* promise, serial callers within the cooldown share the failure result.
|
|
75
|
+
*/
|
|
76
|
+
protected lastRefreshFailure: {
|
|
77
|
+
refreshToken: string;
|
|
78
|
+
result: CallRefreshTokenResult;
|
|
79
|
+
expiresAt: number;
|
|
80
|
+
} | null;
|
|
62
81
|
/**
|
|
63
82
|
* Monotonic counter incremented at the top of `_removeSession`, before any
|
|
64
83
|
* `await`. The commit guard inside `_callRefreshToken` captures this value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoTrueClient.d.ts","sourceRoot":"","sources":["../../src/GoTrueClient.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAU7C,OAAO,EACL,SAAS,EAgBV,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,EAMN,MAAM,aAAa,CAAA;AACpB,OAAO,EAIL,QAAQ,EAgBT,MAAM,eAAe,CAAA;AAOtB,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EAcZ,eAAe,EACf,YAAY,EAEZ,iBAAiB,EACjB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AE,GAChC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,CAC9B;IA2FD;;;;;;;;;OASG;IACG,iBAAiB,CACrB,WAAW,CAAC,EAAE,4BAA4B,GACzC,OAAO,CAAC,uCAAuC,CAAC;IA8CnD;;;;;;;;;OASG;IACG,eAAe,CACnB,WAAW,CAAC,EAAE,0BAA0B,GACvC,OAAO,CAAC,qCAAqC,CAAC;IA4CjD;;;OAGG;YACW,yBAAyB;IAqCvC;;;OAGG;YACW,0BAA0B;IA0CxC;;;OAGG;YACW,2BAA2B;IA4BzC;;;OAGG;YACW,4BAA4B;IAkC1C;;OAEG;YACW,aAAa;IAgC3B;;OAEG;YACW,cAAc;IAqC5B;;OAEG;YACW,cAAc;CAoC7B"}
|
|
@@ -99,6 +99,21 @@ class GoTrueClient {
|
|
|
99
99
|
this.autoRefreshTickTimeout = null;
|
|
100
100
|
this.visibilityChangedCallback = null;
|
|
101
101
|
this.refreshingDeferred = null;
|
|
102
|
+
/**
|
|
103
|
+
* Cache of the most recent refresh failure, keyed by the refresh token
|
|
104
|
+
* that failed. Serial callers passing the *same* token within
|
|
105
|
+
* `REFRESH_FAILURE_COOLDOWN_MS` (including subsequent auto-refresh ticks)
|
|
106
|
+
* receive this cached result instead of firing another `/token` request.
|
|
107
|
+
* Callers passing a *different* token (token rotation pickup, explicit
|
|
108
|
+
* `setSession`/`refreshSession({ refresh_token })`, multi-account switch)
|
|
109
|
+
* bypass the cache and attempt a fresh refresh as they should.
|
|
110
|
+
* Cleared on any successful refresh (locally or via BroadcastChannel from
|
|
111
|
+
* another tab) and on `_removeSession`.
|
|
112
|
+
*
|
|
113
|
+
* Pairs with `refreshingDeferred`: concurrent callers share the in-flight
|
|
114
|
+
* promise, serial callers within the cooldown share the failure result.
|
|
115
|
+
*/
|
|
116
|
+
this.lastRefreshFailure = null;
|
|
102
117
|
/**
|
|
103
118
|
* Monotonic counter incremented at the top of `_removeSession`, before any
|
|
104
119
|
* `await`. The commit guard inside `_callRefreshToken` captures this value
|
|
@@ -234,6 +249,12 @@ class GoTrueClient {
|
|
|
234
249
|
}
|
|
235
250
|
(_c = this.broadcastChannel) === null || _c === void 0 ? void 0 : _c.addEventListener('message', async (event) => {
|
|
236
251
|
this._debug('received broadcast notification from other tab or client', event);
|
|
252
|
+
// Another tab successfully refreshed or signed in — any cached
|
|
253
|
+
// failure in this tab is stale and should not block the next
|
|
254
|
+
// refresh attempt.
|
|
255
|
+
if (event.data.event === 'TOKEN_REFRESHED' || event.data.event === 'SIGNED_IN') {
|
|
256
|
+
this.lastRefreshFailure = null;
|
|
257
|
+
}
|
|
237
258
|
try {
|
|
238
259
|
await this._notifyAllSubscribers(event.data.event, event.data.session, false); // broadcast = false so we don't get an endless loop of messages
|
|
239
260
|
}
|
|
@@ -2464,6 +2485,25 @@ class GoTrueClient {
|
|
|
2464
2485
|
}
|
|
2465
2486
|
const { data: session, error } = await this._callRefreshToken(currentSession.refresh_token);
|
|
2466
2487
|
if (error) {
|
|
2488
|
+
// Proactive-preserve mirror: `_callRefreshToken` keeps the session
|
|
2489
|
+
// in storage when refresh fails non-retryably but the access token
|
|
2490
|
+
// is still inside its real expiry window. Hand the caller the
|
|
2491
|
+
// still-valid session instead of translating the refresh error
|
|
2492
|
+
// into `session: null`. If the access token has actually expired,
|
|
2493
|
+
// the session is genuinely dead and the error stands. Explicit
|
|
2494
|
+
// refresh entry points (`refreshSession`, `setSession`)
|
|
2495
|
+
// intentionally bypass this fallback — they want to know the
|
|
2496
|
+
// refresh failed.
|
|
2497
|
+
const accessTokenStillValid = !!(currentSession.expires_at && currentSession.expires_at * 1000 > Date.now());
|
|
2498
|
+
if (accessTokenStillValid) {
|
|
2499
|
+
// Race guard: a concurrent `signOut` may have cleared storage
|
|
2500
|
+
// during the refresh attempt. Don't hand back a session that no
|
|
2501
|
+
// longer exists on disk.
|
|
2502
|
+
const stillStored = (await (0, helpers_1.getItemAsync)(this.storage, this.storageKey));
|
|
2503
|
+
if (stillStored && stillStored.refresh_token === currentSession.refresh_token) {
|
|
2504
|
+
return this._returnResult({ data: { session: currentSession }, error: null });
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2467
2507
|
return this._returnResult({ data: { session: null }, error });
|
|
2468
2508
|
}
|
|
2469
2509
|
return this._returnResult({ data: { session }, error: null });
|
|
@@ -3964,18 +4004,17 @@ class GoTrueClient {
|
|
|
3964
4004
|
if (this.autoRefreshToken && currentSession.refresh_token) {
|
|
3965
4005
|
const { error } = await this._callRefreshToken(currentSession.refresh_token);
|
|
3966
4006
|
if (error) {
|
|
3967
|
-
//
|
|
3968
|
-
//
|
|
3969
|
-
//
|
|
4007
|
+
// `_callRefreshToken` is the single source of truth for refresh
|
|
4008
|
+
// outcomes: it removes the session itself when the access token
|
|
4009
|
+
// is actually expired, and preserves it when the token is still
|
|
4010
|
+
// valid (proactive-preserve). Don't second-guess that here — a
|
|
4011
|
+
// local `_removeSession` would emit a duplicate `SIGNED_OUT` on
|
|
4012
|
+
// genuine failures and undo the proactive-preserve at init time.
|
|
3970
4013
|
if ((0, errors_1.isAuthRefreshDiscardedError)(error)) {
|
|
3971
4014
|
this._debug(debugName, 'refresh discarded by commit guard', error);
|
|
3972
4015
|
}
|
|
3973
4016
|
else {
|
|
3974
4017
|
this._debug(debugName, 'refresh failed', error);
|
|
3975
|
-
if (!(0, errors_1.isAuthRetryableFetchError)(error)) {
|
|
3976
|
-
this._debug(debugName, 'refresh failed with a non-retryable error, removing the session', error);
|
|
3977
|
-
await this._removeSession();
|
|
3978
|
-
}
|
|
3979
4018
|
}
|
|
3980
4019
|
}
|
|
3981
4020
|
}
|
|
@@ -4024,6 +4063,23 @@ class GoTrueClient {
|
|
|
4024
4063
|
if (this.refreshingDeferred) {
|
|
4025
4064
|
return this.refreshingDeferred.promise;
|
|
4026
4065
|
}
|
|
4066
|
+
// Serial failure cooldown: callers passing the *same* refresh token
|
|
4067
|
+
// after a recent failure receive the cached result instead of firing
|
|
4068
|
+
// another `/token` request. This caps the proactive-refresh storm
|
|
4069
|
+
// where every `getSession()` call inside the 90s EXPIRY_MARGIN_MS
|
|
4070
|
+
// window kept re-firing against the same broken refresh token during
|
|
4071
|
+
// outages. Concurrent callers already share `refreshingDeferred`; this
|
|
4072
|
+
// cache covers serial callers spaced across cooldown windows.
|
|
4073
|
+
//
|
|
4074
|
+
// Token-keyed so callers with a fresh refresh token (rotation pickup
|
|
4075
|
+
// from another tab, explicit `setSession`/`refreshSession({ refresh_token })`,
|
|
4076
|
+
// multi-account switch) bypass the cache and attempt a real refresh.
|
|
4077
|
+
if (this.lastRefreshFailure &&
|
|
4078
|
+
this.lastRefreshFailure.refreshToken === refreshToken &&
|
|
4079
|
+
Date.now() < this.lastRefreshFailure.expiresAt) {
|
|
4080
|
+
this._debug('#_callRefreshToken()', 'returning cached failure (cooldown active)');
|
|
4081
|
+
return this.lastRefreshFailure.result;
|
|
4082
|
+
}
|
|
4027
4083
|
// Refresh tokens are long-lived bearer credentials; do NOT include any
|
|
4028
4084
|
// fragment of the token in the debug tag, even when `debug: true` is
|
|
4029
4085
|
// enabled (logs may be forwarded to third-party services).
|
|
@@ -4089,6 +4145,9 @@ class GoTrueClient {
|
|
|
4089
4145
|
}
|
|
4090
4146
|
await this._notifyAllSubscribers('TOKEN_REFRESHED', data.session);
|
|
4091
4147
|
const result = { data: data.session, error: null };
|
|
4148
|
+
// Refresh succeeded — clear any cached failure so the next caller
|
|
4149
|
+
// (including the auto-refresh ticker) attempts a real refresh again.
|
|
4150
|
+
this.lastRefreshFailure = null;
|
|
4092
4151
|
this.refreshingDeferred.resolve(result);
|
|
4093
4152
|
return result;
|
|
4094
4153
|
}
|
|
@@ -4097,8 +4156,35 @@ class GoTrueClient {
|
|
|
4097
4156
|
if ((0, errors_1.isAuthError)(error)) {
|
|
4098
4157
|
const result = { data: null, error };
|
|
4099
4158
|
if (!(0, errors_1.isAuthRetryableFetchError)(error)) {
|
|
4100
|
-
|
|
4159
|
+
// Proactive vs reactive distinction: a refresh fires whenever
|
|
4160
|
+
// the access token is within EXPIRY_MARGIN_MS of expiry. If the
|
|
4161
|
+
// access token is *still valid* at this moment, the refresh was
|
|
4162
|
+
// proactive and the existing session is still usable until its
|
|
4163
|
+
// real expiry — destroying it now would log out a user whose
|
|
4164
|
+
// access token works. If the access token has actually expired,
|
|
4165
|
+
// the refresh token is the only credential left and it just got
|
|
4166
|
+
// rejected — the session is genuinely dead. `__loadSession`
|
|
4167
|
+
// mirrors this distinction on the read path so callers see the
|
|
4168
|
+
// preserved session instead of `session: null`.
|
|
4169
|
+
const storedNow = (await (0, helpers_1.getItemAsync)(this.storage, this.storageKey));
|
|
4170
|
+
const accessTokenStillValid = !!((storedNow === null || storedNow === void 0 ? void 0 : storedNow.expires_at) && storedNow.expires_at * 1000 > Date.now());
|
|
4171
|
+
if (accessTokenStillValid) {
|
|
4172
|
+
this._debug(debugName, 'proactive refresh failed, access token still valid — preserving session');
|
|
4173
|
+
}
|
|
4174
|
+
else {
|
|
4175
|
+
await this._removeSession();
|
|
4176
|
+
}
|
|
4101
4177
|
}
|
|
4178
|
+
// Cache the failure so serial callers (and the next auto-refresh
|
|
4179
|
+
// tick) passing the same refresh token within the cooldown window
|
|
4180
|
+
// receive it synchronously instead of firing another `/token`
|
|
4181
|
+
// call. Set after the optional `_removeSession` above (which
|
|
4182
|
+
// clears the cache as part of teardown) so the cache survives.
|
|
4183
|
+
this.lastRefreshFailure = {
|
|
4184
|
+
refreshToken,
|
|
4185
|
+
result,
|
|
4186
|
+
expiresAt: Date.now() + constants_1.REFRESH_FAILURE_COOLDOWN_MS,
|
|
4187
|
+
};
|
|
4102
4188
|
(_a = this.refreshingDeferred) === null || _a === void 0 ? void 0 : _a.resolve(result);
|
|
4103
4189
|
return result;
|
|
4104
4190
|
}
|
|
@@ -4186,6 +4272,9 @@ class GoTrueClient {
|
|
|
4186
4272
|
// `_callRefreshToken`. See `_sessionRemovalEpoch` field doc.
|
|
4187
4273
|
this._sessionRemovalEpoch += 1;
|
|
4188
4274
|
this._debug('#_removeSession()');
|
|
4275
|
+
// The session is gone — no point holding on to a cached refresh failure
|
|
4276
|
+
// for a token that no longer exists. Synchronous, before any `await`.
|
|
4277
|
+
this.lastRefreshFailure = null;
|
|
4189
4278
|
this.suppressGetSessionWarning = false;
|
|
4190
4279
|
await (0, helpers_1.removeItemAsync)(this.storage, this.storageKey);
|
|
4191
4280
|
await (0, helpers_1.removeItemAsync)(this.storage, this.storageKey + '-code-verifier');
|