fix(auth): prevent auto-login after logout
This commit is contained in:
parent
ff2ba87161
commit
49df3dce90
1 changed files with 1 additions and 13 deletions
|
|
@ -30,19 +30,7 @@ export default function LoginPage() {
|
|||
router.refresh();
|
||||
return;
|
||||
}
|
||||
if (!data.password) {
|
||||
const loginRes = await fetch(`${baseUrl}/api/auth/login`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ password: "123456" }),
|
||||
});
|
||||
if (loginRes.ok) {
|
||||
router.push("/dashboard");
|
||||
router.refresh();
|
||||
return;
|
||||
}
|
||||
}
|
||||
setHasPassword(!!data.password);
|
||||
setHasPassword(!!data.hasPassword);
|
||||
}
|
||||
} catch (err) {
|
||||
clearTimeout(timeoutId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue