Logout now calls the logout endpoint, role is now stored in local storage as well

This commit is contained in:
hz
2025-05-13 10:58:45 -07:00
parent 643b525d1b
commit 6a1697048c
3 changed files with 35 additions and 3 deletions
+5 -1
View File
@@ -82,7 +82,11 @@ const Login = () => {
}
const data = await res.json();
login(data.token);
login(data.accessToken);
localStorage.setItem("token", data.accessToken);
localStorage.setItem("role", data.role);
navigate("/dashboard");
} catch (err) {
console.error("Login error:", err);