Compare commits
2 Commits
039309c75a
...
936a1f93aa
Author | SHA1 | Date | |
---|---|---|---|
936a1f93aa | |||
d5d0e5ffc9 |
web
@ -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}
|
||||||
|
</>
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user