Skip to content

fix: disable setup page once setup has been completed #9198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 22, 2023
Prev Previous commit
Next Next commit
I think I just need to mock this...
  • Loading branch information
aslilac committed Aug 18, 2023
commit 550d74167dc0a7f0b4a6a01a8688df1c147ac849
6 changes: 6 additions & 0 deletions site/src/pages/SetupPage/SetupPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ describe("Setup Page", () => {
rest.get("/api/v2/users/me", (req, res, ctx) => {
return res(ctx.status(401), ctx.json({ message: "no user here" }))
}),
rest.get("/api/v2/users/first", (req, res, ctx) => {
return res(
ctx.status(404),
ctx.json({ message: "no first user has been created" }),
)
}),
)
})

Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/SetupPage/SetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const SetupPage: FC = () => {
) {
navigate("/login", { state: { isRedirect: true } })
}
}, [authState])
}, [authState, navigate])

return (
<>
Expand Down