chore: update auth checks

This commit is contained in:
Steven
2023-07-11 23:39:19 +08:00
parent 1cbab78989
commit fcd72e1f98
3 changed files with 13 additions and 5 deletions

View File

@ -19,7 +19,11 @@ const SignIn: React.FC = () => {
const allowConfirm = email.length > 0 && password.length > 0;
useEffect(() => {
api.signout();
if (userStore.getCurrentUser()) {
return navigate("/", {
replace: true,
});
}
}, []);
const handleEmailInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {