mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(auth): prevent auto-login after logout
This commit is contained in:
+1
-13
@@ -30,19 +30,7 @@ export default function LoginPage() {
|
|||||||
router.refresh();
|
router.refresh();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!data.password) {
|
setHasPassword(!!data.hasPassword);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
|
|||||||
Reference in New Issue
Block a user