mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 05:48:42 -06:00
Fix login by serving users file via API
This commit is contained in:
@@ -8,7 +8,7 @@ export default function Login({ onLogin }) {
|
||||
const [error, setError] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
fetch("/users.json")
|
||||
fetch("/api/users")
|
||||
.then((res) => res.json())
|
||||
.then((data) => setUsers(data.users || []))
|
||||
.catch(() => setUsers([]));
|
||||
@@ -30,7 +30,7 @@ export default function Login({ onLogin }) {
|
||||
return;
|
||||
}
|
||||
const hash = await sha512(password);
|
||||
if (hash === user.password) {
|
||||
if (hash.toLowerCase() === (user.password || "").toLowerCase()) {
|
||||
setError("");
|
||||
onLogin(username);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user