cloudflare-next-intl 0.6.12 → 0.6.13
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.
|
@@ -277,7 +277,7 @@ export default async function updateSession(request, baseResponse, locale) {
|
|
|
277
277
|
// to reach yet either.
|
|
278
278
|
response = buildRedirect(baseResponse, localeUrl(fa.verifyEmailPath));
|
|
279
279
|
}
|
|
280
|
-
else if (isAuthPage || (isVerifyEmailPage && decodeJwtPayload(token)?.email_verified
|
|
280
|
+
else if (isAuthPage || (isVerifyEmailPage && decodeJwtPayload(token)?.email_verified === true)) {
|
|
281
281
|
// A verified user has no reason to be on verifyEmailPath either —
|
|
282
282
|
// same "you're done here, go home" treatment as an auth page.
|
|
283
283
|
// `unverifiedEmail` can't be reused here: its own computation
|
|
@@ -285,7 +285,13 @@ export default async function updateSession(request, baseResponse, locale) {
|
|
|
285
285
|
// from that page for an unverified user), so it's always `false`
|
|
286
286
|
// while already on it regardless of actual verification status —
|
|
287
287
|
// checking the claim again directly is what tells verified and
|
|
288
|
-
// unverified apart on this specific page.
|
|
288
|
+
// unverified apart on this specific page. Requires an EXPLICIT
|
|
289
|
+
// `true` (not just "not false") — a missing/undefined claim must
|
|
290
|
+
// NOT redirect home here, since `AuthUserProvider`'s client-side
|
|
291
|
+
// effect treats that same user as unverified via the live SDK's
|
|
292
|
+
// boolean `user.emailVerified`. The two disagreeing caused an
|
|
293
|
+
// infinite client<->server redirect loop on this exact page when a
|
|
294
|
+
// token's claim was merely absent rather than `false`.
|
|
289
295
|
response = buildRedirect(baseResponse, localeUrl(fa.homePath));
|
|
290
296
|
}
|
|
291
297
|
else {
|