mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Add Login page
This commit is contained in:
@@ -8,7 +8,7 @@ export async function check_auth_status() {
|
||||
const re = await fetch("/api/user");
|
||||
const u: JSONResult<BUser> = await re.json();
|
||||
if (u.ok) return true;
|
||||
if (u.status !== 404 && u.status !== 1) {
|
||||
if (u.status !== 404 && u.status !== 1 && u.status !== 401) {
|
||||
throw Error(u.error);
|
||||
}
|
||||
const re2 = await fetch("/api/status");
|
||||
@@ -20,5 +20,5 @@ export async function check_auth_status() {
|
||||
if (!parse_bool(localStorage.getItem("skip_create_root_user"), false)) {
|
||||
set_state("#/create_root_user");
|
||||
}
|
||||
}
|
||||
} else set_state("#/login");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user