mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
fix /setup redirect issue
This commit is contained in:
@@ -9,7 +9,6 @@ RUN npm install --legacy-peer-deps
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npx drizzle-kit generate --dialect sqlite --schema ./server/db/schema.ts --out migrations
|
RUN npx drizzle-kit generate --dialect sqlite --schema ./server/db/schema.ts --out migrations
|
||||||
RUN ls migrations
|
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -22,25 +22,6 @@ export default async function RootLayout({
|
|||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
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 (
|
return (
|
||||||
<html suppressHydrationWarning>
|
<html suppressHydrationWarning>
|
||||||
<body className={`${font.className} pb-3`}>
|
<body className={`${font.className} pb-3`}>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ export default async function Page(props: {
|
|||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
redirect("/auth/login");
|
redirect("/auth/login");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let orgs: ListOrgsResponse["orgs"] = [];
|
let orgs: ListOrgsResponse["orgs"] = [];
|
||||||
@@ -25,13 +24,19 @@ export default async function Page(props: {
|
|||||||
`/orgs`,
|
`/orgs`,
|
||||||
await authCookieHeader()
|
await authCookieHeader()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (res && res.data.data.orgs) {
|
if (res && res.data.data.orgs) {
|
||||||
orgs = res.data.data.orgs;
|
orgs = res.data.data.orgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!orgs.length) {
|
||||||
|
redirect("/setup");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LandingProvider user={user}>
|
<LandingProvider user={user}>
|
||||||
|
|||||||
Reference in New Issue
Block a user