fix(auth): redirect active sessions from /login

/api/auth/status did not expose whether the auth cookie corresponds to a
valid dashboard session, so /login could only detect "auth disabled"
(requireLogin === false) and not "already logged in". Add authenticated
to the status response and redirect from /login when it's true.
This commit is contained in:
DaDecky authored and decolua committed 2026-08-05 10:27:27 +07:00
1 parent 918b3c87a1
commit ae4f76c433
3 files changed
+72 -1

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ export default function LoginPage() {
if (res.ok) {
const data = await res.json();
if (data.requireLogin === false) {
if (data.authenticated === true || data.requireLogin === false) {
window.location.assign("/dashboard");
return;
}