mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
fix(auth): prevent auto-login after logout
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user