ThreadCount Community edition
Uniform stock management for healthcare linen rooms. Licensed under the GNU AGPL v3.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { currentOperator } from "@/lib/ops/session";
|
||||
import { Rail } from "./Rail";
|
||||
|
||||
/* Everything in this group needs a signed-in operator. The sign-in page sits outside the group
|
||||
* so it is reachable without one. The proxy already turned away requests with no valid tc_ops
|
||||
* cookie; this re-reads the row, so a deactivated operator or a changed password ends the
|
||||
* session here even if the token still verifies. */
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function ConsoleLayout({ children }: { children: React.ReactNode }) {
|
||||
const op = await currentOperator();
|
||||
if (!op) redirect("/ops/login");
|
||||
return (
|
||||
<div style={{ display: "flex", minHeight: "100vh", alignItems: "stretch" }}>
|
||||
<Rail name={op.name} email={op.email} role={op.role} viaSso={op.viaSso} totpEnabled={op.totpEnabled} />
|
||||
<main style={{ flex: 1, minWidth: 0, padding: "0 32px 32px" }}>{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user