This commit is contained in:
parent
f205a16ee8
commit
0fba1e14dd
@ -1,16 +1,18 @@
|
||||
"use client"
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import Header from "./header";
|
||||
|
||||
const logged_in: boolean = false
|
||||
export default async function Webpage({children}: Readonly<{children?: React.ReactNode}>) {
|
||||
const cookieStore = await cookies()
|
||||
const session_id = cookieStore.get("session_id")
|
||||
|
||||
export default function Webpage({children}: Readonly<{children?: React.ReactNode}>) {
|
||||
if (logged_in) {
|
||||
return <>
|
||||
<Header/>
|
||||
{children}
|
||||
</>
|
||||
if (!session_id) {
|
||||
redirect("https://auth.staging.strafes.net/")
|
||||
return <></>
|
||||
}
|
||||
window.location.href = "https://auth.staging.strafes.net/"
|
||||
return <></>
|
||||
return <>
|
||||
<Header/>
|
||||
{children}
|
||||
</>
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user