Something went wrong, please try again.
@@ -95,12 +110,15 @@ const { register, handleSubmit } = useForm();
) : (
""
)}
+ {/* if the inserted token is invalid, show invalid error!
+ this also shows if the token used in checkLogIn() is invalid */}
{isInvalid ? (
Invalid token.
) : (
""
)}
- {localStorage.getItem("user") && localStorage.getItem("token") ? (
+ { // if there's a user object in localstorage, and there's a token in localstorage, the user is logged in already
+ localStorage.getItem("user") && localStorage.getItem("token") ? (
<>
You are logged in already, click here to continue to the dash.
@@ -113,6 +131,7 @@ const { register, handleSubmit } = useForm();
>
) : (
+ // otherwise, show login form