fix: redirect expired portal sessions
This commit is contained in:
1 parent
b1ef4a8186
commit
1279f46b1f
4 files changed
+69
-4
No files matched your search
@@ -3,10 +3,11 @@ import type { ReactNode } from "react";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
import { PortalShell } from "@/components/layout/portal-shell";
|
||||
import { requirePageAccess } from "@/modules/auth/page-access";
|
||||
import { requireAdmin } from "@/modules/auth/principal";
|
||||
|
||||
export default async function AdminLayout({ children }: Readonly<{ children: ReactNode }>) {
|
||||
await requireAdmin(new Headers(await headers()));
|
||||
await requirePageAccess(async () => requireAdmin(new Headers(await headers())));
|
||||
|
||||
return (
|
||||
<PortalShell
|
||||
@@ -23,4 +24,4 @@ export default async function AdminLayout({ children }: Readonly<{ children: Rea
|
||||
{children}
|
||||
</PortalShell>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { PortalShell } from "@/components/layout/portal-shell";
|
||||
import { requirePageAccess } from "@/modules/auth/page-access";
|
||||
|
||||
import { requireEditorial } from "./access";
|
||||
|
||||
export default async function EditorialLayout({ children }: Readonly<{ children: ReactNode }>) {
|
||||
await requireEditorial();
|
||||
await requirePageAccess(requireEditorial);
|
||||
|
||||
return (
|
||||
<PortalShell
|
||||
@@ -21,4 +22,4 @@ export default async function EditorialLayout({ children }: Readonly<{ children:
|
||||
{children}
|
||||
</PortalShell>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user