mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-19 02:04:30 +02:00
fix /setup redirect issue
This commit is contained in:
parent
8a8c42e3b1
commit
4a5bd7e18a
3 changed files with 6 additions and 21 deletions
|
@ -22,25 +22,6 @@ export default async function RootLayout({
|
|||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const user = await verifySession();
|
||||
|
||||
let orgs: ListOrgsResponse["orgs"] = [];
|
||||
if (user) {
|
||||
try {
|
||||
const res = await internal.get<AxiosResponse<ListOrgsResponse>>(
|
||||
`/orgs`,
|
||||
await authCookieHeader()
|
||||
);
|
||||
if (res && res.data.data.orgs) {
|
||||
orgs = res.data.data.orgs;
|
||||
}
|
||||
} catch {}
|
||||
|
||||
if (!orgs.length) {
|
||||
redirect(`/setup`);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<html suppressHydrationWarning>
|
||||
<body className={`${font.className} pb-3`}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue