Initial working commit
Some checks failed
Automated Container Build / build-and-push (push) Failing after 7s
Some checks failed
Automated Container Build / build-and-push (push) Failing after 7s
This commit is contained in:
parent
666ceb7325
commit
b7ce314f01
105 changed files with 35510 additions and 11 deletions
21
src/app/(protected)/layout.tsx
Normal file
21
src/app/(protected)/layout.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { isAuthenticated } from "@/lib/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Navbar } from "@/components/ui/Navbar";
|
||||
|
||||
export default async function ProtectedLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const authed = await isAuthenticated();
|
||||
if (!authed) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Navbar />
|
||||
<main className="flex-1">{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue