Implemented protected route component, added protected routes. Fixed redircts. Removed token from localstorage, not being used
This commit is contained in:
1 parent
5beaa8dfe1
commit
b84a5e017d
4 files changed
+26
-14
No files matched your search
@@ -52,9 +52,7 @@ const Login = () => {
|
||||
await loginValidation.validateAsync(form, { abortEarly: false });
|
||||
const action = await dispatch(login(form));
|
||||
if (action.meta.requestStatus === "fulfilled") {
|
||||
const token = action.payload.data;
|
||||
localStorage.setItem("token", token);
|
||||
navigate("/");
|
||||
navigate("/monitors");
|
||||
}
|
||||
if (action.meta.requestStatus === "rejected") {
|
||||
const error = new Error("Request rejected");
|
||||
|
||||
Reference in new issue
Block a user