mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-23 21:34:24 +00:00
chore: update auth checks
This commit is contained in:
@@ -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>) => {
|
||||
|
@@ -20,6 +20,12 @@ const SignUp: React.FC = () => {
|
||||
const allowConfirm = email.length > 0 && nickname.length > 0 && password.length > 0;
|
||||
|
||||
useEffect(() => {
|
||||
if (userStore.getCurrentUser()) {
|
||||
return navigate("/", {
|
||||
replace: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (disallowSignUp) {
|
||||
return navigate("/auth", {
|
||||
replace: true,
|
||||
@@ -27,10 +33,6 @@ const SignUp: React.FC = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
api.signout();
|
||||
}, []);
|
||||
|
||||
const handleEmailInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const text = e.target.value as string;
|
||||
setEmail(text);
|
||||
|
Reference in New Issue
Block a user