Compare commits

...

2 Commits

2 changed files with 16 additions and 6 deletions
web
package.json
src/app/_components

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3000", "dev": "next dev -p 3000 --turbopack",
"build": "next build", "build": "next build",
"start": "next start -p 3000", "start": "next start -p 3000",
"lint": "next lint" "lint": "next lint"

@ -1,8 +1,18 @@
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import Header from "./header"; import Header from "./header";
export default function Webpage({children}: Readonly<{children?: React.ReactNode}>) { export default async function Webpage({children}: Readonly<{children?: React.ReactNode}>) {
return (<> const cookieStore = await cookies()
<Header/> const session_id = cookieStore.get("session_id")
{children}
</>) if (!session_id) {
redirect("https://auth.staging.strafes.net/")
return <></>
}
return <>
<Header/>
{children}
</>
} }