cloudflare-next-intl 0.10.11 → 0.10.14
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.
|
@@ -197,7 +197,9 @@ export default async function updateSession(request, baseResponse, locale, rebui
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
const isWhiteListed =
|
|
200
|
+
const isWhiteListed = fa.protectedPaths
|
|
201
|
+
? !fa.protectedPaths(path) && !fa.isAuthPath(path)
|
|
202
|
+
: isWhitelisted(path, fa.whiteListPaths);
|
|
201
203
|
if (isWhiteListed)
|
|
202
204
|
return baseResponse;
|
|
203
205
|
const isAuthPage = fa.isAuthPath(path);
|
|
@@ -4,5 +4,6 @@ export interface LoadResolvedFirebaseAuthOptions {
|
|
|
4
4
|
viteConfig: Pick<ResolvedConfig, "root" | "envDir" | "mode"> & {
|
|
5
5
|
resolve: Pick<ResolvedConfig["resolve"], "alias">;
|
|
6
6
|
};
|
|
7
|
+
envDefaults?: Record<string, string>;
|
|
7
8
|
}
|
|
8
9
|
export declare function loadResolvedFirebaseAuth(options: LoadResolvedFirebaseAuthOptions): Promise<Record<string, unknown> | undefined>;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export async function loadResolvedFirebaseAuth(options) {
|
|
2
2
|
let server;
|
|
3
|
+
const restoreEnv = [];
|
|
4
|
+
for (const [key, value] of Object.entries(options.envDefaults ?? {})) {
|
|
5
|
+
if (process.env[key])
|
|
6
|
+
continue;
|
|
7
|
+
restoreEnv.push([key, process.env[key]]);
|
|
8
|
+
process.env[key] = value;
|
|
9
|
+
}
|
|
3
10
|
try {
|
|
4
11
|
const { createServer } = await import("vite");
|
|
5
12
|
server = await createServer({
|
|
@@ -47,5 +54,11 @@ export async function loadResolvedFirebaseAuth(options) {
|
|
|
47
54
|
}
|
|
48
55
|
finally {
|
|
49
56
|
await server?.close();
|
|
57
|
+
for (const [key, value] of restoreEnv) {
|
|
58
|
+
if (value === undefined)
|
|
59
|
+
delete process.env[key];
|
|
60
|
+
else
|
|
61
|
+
process.env[key] = value;
|
|
62
|
+
}
|
|
50
63
|
}
|
|
51
64
|
}
|
|
@@ -148,6 +148,7 @@ export interface FirebaseAuthRoutingConfig {
|
|
|
148
148
|
preserveRedirectQuery?: boolean;
|
|
149
149
|
isAuthPath: (path: string) => boolean;
|
|
150
150
|
whiteListPaths?: readonly string[];
|
|
151
|
+
protectedPaths?: (path: string) => boolean;
|
|
151
152
|
sessionCookieMaxAge?: number;
|
|
152
153
|
refreshTokenCookieMaxAge?: number;
|
|
153
154
|
sessionCookieName?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudflare-next-intl",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.14",
|
|
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",
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
"dependencies": {
|
|
360
360
|
"@microsoft/clarity": "^1.0.2",
|
|
361
361
|
"cloudflare-next-intl-db": "^0.2.3",
|
|
362
|
-
"cloudflare-next-intl-db-codegen": "^0.1.
|
|
362
|
+
"cloudflare-next-intl-db-codegen": "^0.1.2",
|
|
363
363
|
"jose": "^6.2.8",
|
|
364
364
|
"sharp": "^0.34.5 || ^0.35.0"
|
|
365
365
|
},
|