cloudflare-next-intl 0.8.25 → 0.8.27

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.
@@ -35,6 +35,8 @@ function resolveActionModePaths(fa) {
35
35
  paths.verifyEmail = fa.verifyEmailPath;
36
36
  if (fa.recoverEmailPath)
37
37
  paths.recoverEmail = fa.recoverEmailPath;
38
+ if (fa.signInPath)
39
+ paths.signIn = fa.signInPath;
38
40
  return { ...paths, ...fa.actionModePaths };
39
41
  }
40
42
  export const DEFAULT_SESSION_MAX_AGE = 60 * 60 * 24 * 5;
@@ -256,7 +258,13 @@ export default async function updateSession(request, baseResponse, locale, rebui
256
258
  continuePath = '/';
257
259
  }
258
260
  }
259
- if (continuePath !== '/') {
261
+ // A continueUrl pointing back at the request's own
262
+ // path (e.g. the single project-wide action URL
263
+ // echoing itself as `actionCodeSettings.url`)
264
+ // carries no routing information — keep the
265
+ // mode-derived target instead of overwriting it
266
+ // with a no-op.
267
+ if (continuePath !== '/' && continuePath !== path) {
260
268
  target = continuePath;
261
269
  }
262
270
  }
@@ -370,7 +378,15 @@ export default async function updateSession(request, baseResponse, locale, rebui
370
378
  if (result.status === 'refreshed') {
371
379
  refreshedToken = { idToken: result.idToken, refreshToken: result.refreshToken };
372
380
  token = refreshedToken.idToken;
373
- unverifiedEmail = decodeJwtPayload(token)?.email_verified === false;
381
+ // The hint can say `true` (client already confirmed
382
+ // verification live) while this refreshed claim still
383
+ // says `false` — token-claim propagation on Google's
384
+ // backend can lag behind the account-info read `reload()`
385
+ // used to set the hint. Trusting the stale claim here
386
+ // would redirect to verifyEmailPath, which independently
387
+ // resolves the user as verified via `getAuthUser()` and
388
+ // redirects home — an infinite loop. Hint `true` wins.
389
+ unverifiedEmail = hint !== 'true' && decodeJwtPayload(token)?.email_verified === false;
374
390
  }
375
391
  else if (result.status === 'invalid') {
376
392
  clearInvalidSession = true;
@@ -508,6 +508,13 @@ export interface FirebaseAuthRoutingConfig {
508
508
  * warning.
509
509
  */
510
510
  recoverEmailPath?: string;
511
+ /**
512
+ * Path handling an emailed passwordless `signIn` action link. Omit to
513
+ * leave that mode unhandled — the request then falls through to normal
514
+ * routing instead of being forwarded. Must start with "/" —
515
+ * `setIntlConfig` auto-corrects a missing leading slash with a warning.
516
+ */
517
+ signInPath?: string;
511
518
  /**
512
519
  * Extra/overriding `?mode=` → path entries for the emailed-action-link
513
520
  * forward described on {@link resetPasswordPath}. Merged over the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-next-intl",
3
- "version": "0.8.25",
3
+ "version": "0.8.27",
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",