Adding login auth

This commit is contained in:
hz
2025-05-12 23:06:52 -07:00
parent 0a903bad0b
commit b29018b1dd
11 changed files with 78 additions and 190 deletions
+2 -2
View File
@@ -81,8 +81,8 @@ const Login = () => {
}
const data = await res.json();
login(data.token); // Save to context/localStorage
navigate("/");
login(data.token);
navigate("/dashboard");
} catch (err) {
console.error("Login error:", err);
alert("Login failed: " + err.message);