web: Revert auth redirect
This commit is contained in:
parent
a9afdf38cf
commit
251a24efae
@ -1,22 +1,8 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import Header from "./header";
|
||||
|
||||
export default function Webpage({children}: Readonly<{children?: React.ReactNode}>) {
|
||||
//check if the user is logged into the auth
|
||||
useEffect(() => {
|
||||
const cookies = document.cookie.split("; ")
|
||||
const hasCookie = cookies.some(cookie => cookie.startsWith("session_id="))
|
||||
if (!hasCookie) {
|
||||
redirect("https://auth.staging.strafes.net/")
|
||||
}
|
||||
}, [])
|
||||
|
||||
return <>
|
||||
<Header/>
|
||||
{children}
|
||||
</>
|
||||
return (<>
|
||||
<Header/>
|
||||
{children}
|
||||
</>)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user