mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-19 02:04:30 +02:00
prevent static optimization on root page
This commit is contained in:
parent
976635e5fe
commit
4706dea3bf
3 changed files with 31 additions and 37 deletions
|
@ -24,24 +24,22 @@ export default async function RootLayout({
|
|||
}>) {
|
||||
const user = await verifySession();
|
||||
|
||||
console.log("layout.tsx user", user);
|
||||
|
||||
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 (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`);
|
||||
// }
|
||||
// }
|
||||
if (!orgs.length) {
|
||||
redirect(`/setup`);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<html suppressHydrationWarning>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue