cloudflare-next-intl 0.8.36 → 0.8.37
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.
|
@@ -246,7 +246,20 @@ export default function AuthUserProvider({ initialUser = null, children }) {
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
const flipped = previous !== undefined && previous !== isSignedIn;
|
|
249
|
-
|
|
249
|
+
// `contradictsPage` infers "the server rendered this page for
|
|
250
|
+
// the opposite auth state, resync it" from the page's own
|
|
251
|
+
// auth/non-auth role. On a whitelisted path that inference is
|
|
252
|
+
// meaningless — the page renders identically signed-in or
|
|
253
|
+
// signed-out and neither guard ever redirects away from it —
|
|
254
|
+
// so a signed-out visitor on a non-auth whitelisted page
|
|
255
|
+
// (`isSignedIn === isAuthPage`, both false) matched on the
|
|
256
|
+
// first observation and refreshed. That refresh re-primes the
|
|
257
|
+
// router cache, re-firing every in-viewport `<Link>` prefetch,
|
|
258
|
+
// which lands back here and repeats: an unbounded refresh loop
|
|
259
|
+
// on exactly the public landing pages whitelisting exists for.
|
|
260
|
+
// A real `flipped` transition still refreshes, whitelisted or
|
|
261
|
+
// not — that one observed an actual state change.
|
|
262
|
+
const contradictsPage = !isWhiteListed && previous === undefined && isSignedIn === isAuthPage;
|
|
250
263
|
if (flipped || contradictsPage) {
|
|
251
264
|
router.refresh();
|
|
252
265
|
}
|
|
@@ -257,7 +270,7 @@ export default function AuthUserProvider({ initialUser = null, children }) {
|
|
|
257
270
|
unsubscribe?.();
|
|
258
271
|
};
|
|
259
272
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
260
|
-
}, [router, isAuthPage, maxAge, sessionCookieName, refreshTokenMaxAge, refreshTokenCookieName, emailVerifiedHintCookieName, appCheckTokenCookieName, appCheckTokenMaxAge]);
|
|
273
|
+
}, [router, isAuthPage, isWhiteListed, maxAge, sessionCookieName, refreshTokenMaxAge, refreshTokenCookieName, emailVerifiedHintCookieName, appCheckTokenCookieName, appCheckTokenMaxAge]);
|
|
261
274
|
const reloadUser = useCallback(async () => {
|
|
262
275
|
const { auth } = await getFirebaseAuthClient();
|
|
263
276
|
const user = auth.currentUser;
|