mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-30 09:15:19 +02:00
Merge branch 'main' into dev
This commit is contained in:
+8
-3
@@ -29,14 +29,19 @@ export default async function Page(props: {
|
||||
|
||||
const user = await verifySession({ skipCheckVerifyEmail: true });
|
||||
|
||||
let complete = false;
|
||||
let complete: boolean | null = null; // null means "unknown" (request errored)
|
||||
try {
|
||||
const setupRes = await internal.get<
|
||||
AxiosResponse<InitialSetupCompleteResponse>
|
||||
>(`/auth/initial-setup-complete`, await authCookieHeader());
|
||||
complete = setupRes.data.data.complete;
|
||||
} catch (e) {}
|
||||
if (!complete) {
|
||||
} catch (e) {
|
||||
// Swallow errors (e.g. 429 rate limit, 500, network failure).
|
||||
// Only redirect to initial-setup when the server *confirms* setup
|
||||
// is incomplete (complete === false). If the request itself failed we
|
||||
// cannot tell, so fall through to the login redirect instead.
|
||||
}
|
||||
if (complete === false) {
|
||||
redirect("/auth/initial-setup");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user