cloudflare-next-intl 0.6.32 → 0.6.34

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,8 +24,15 @@ export const defaultIgnoredConsoleErrors = [
24
24
  'auth/expired-action-code',
25
25
  'auth/invalid-action-code',
26
26
  'auth/user-token-expired',
27
+ // Logged by `initializeServerApp` itself (not thrown) when a session
28
+ // cookie's token is revoked/stale — `getAuthenticatedAppForUser` already
29
+ // handles it by refreshing and retrying, so it's noise, not a bug.
30
+ 'auth/invalid-user-token',
31
+ 'FirebaseServerApp could not login user with provided authIdToken',
27
32
  'The `punycode` module is deprecated. Please use a userland alternative instead.',
28
33
  'failed to pipe response',
34
+ "FirebaseServerApp authIdToken is invalid: the token has expired.",
35
+ "failed Error: Database is closing/hidden",
29
36
  'Failed to fetch RSC payload',
30
37
  ...(process.env.NODE_ENV === 'development'
31
38
  ? ['A DurableObjectNamespace in the config referenced the class "DOQueueHandler", but no such Durable Object class is exported from the worker. Please make sure the class name matches,']
@@ -302,6 +302,26 @@ export default async function updateSession(request, baseResponse, locale, rebui
302
302
  // the claim is still accurate. Only when the hint AGREES with the claim
303
303
  // is a refresh skipped, so a genuinely unverified user with an
304
304
  // established, agreeing hint doesn't pay a refresh on every request.
305
+ // On verifyEmailPath itself the branch above deliberately never runs, so
306
+ // a token minted before the user verified keeps the page pinned even
307
+ // after the client has confirmed verification and mirrored it into the
308
+ // hint cookie. Refresh once when the hint claims `true` against a stale
309
+ // `false` claim, so the redirect-home branch below can observe it.
310
+ if (isVerifyEmailPage && hasSession && !refreshedToken
311
+ && decodeJwtPayload(token)?.email_verified === false
312
+ && request.cookies.get(emailVerifiedHintCookieName)?.value === 'true') {
313
+ const refreshToken = request.cookies.get(refreshTokenCookieName)?.value;
314
+ if (refreshToken) {
315
+ const result = await refreshIdToken(fa.apiKey, refreshToken);
316
+ if (result.status === 'refreshed') {
317
+ refreshedToken = { idToken: result.idToken, refreshToken: result.refreshToken };
318
+ token = refreshedToken.idToken;
319
+ }
320
+ else if (result.status === 'invalid') {
321
+ clearInvalidSession = true;
322
+ }
323
+ }
324
+ }
305
325
  let unverifiedEmail = false;
306
326
  if (fa.verifyEmailPath && !isVerifyEmailPage && hasSession && decodeJwtPayload(token)?.email_verified === false) {
307
327
  const hint = request.cookies.get(emailVerifiedHintCookieName)?.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.6.32",
3
+ "version": "0.6.34",
4
4
  "description": "Optimized Next Intl Package Special for App Router and Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",