fix: use canonical Auth.js session in proxy
Remote Build and Deploy / deploy (push) Successful in 43s

This commit is contained in:
Simo committed 2026-07-11 22:55:26 +02:00
1 parent cfa7998dd7
commit c4bf6488d0
3 files changed
+8 -39

No files matched your search

-9
View File
@@ -2,15 +2,6 @@ export interface ProxyToken {
rank?: unknown;
}
const AUTH_COOKIE_NAMES = ["__Secure-authjs.session-token", "authjs.session-token"] as const;
export function authSessionCookieName(cookieNames: readonly string[]): string | null {
for (const base of AUTH_COOKIE_NAMES) {
if (cookieNames.some((name) => name === base || name.startsWith(`${base}.`))) return base;
}
return null;
}
export function shouldRedirectAdminRequest(pathname: string, token: ProxyToken | null): boolean {
if (pathname !== "/admin" && !pathname.startsWith("/admin/")) return false;
return token === null;