Fix sign in/useEffect usage
This commit is contained in:
parent
64edb8581a
commit
9666d7deb2
@ -49,12 +49,15 @@ export default function SignInForm({
|
|||||||
if (response === KEY_CREDENTIALS_SUCCESS) {
|
if (response === KEY_CREDENTIALS_SUCCESS) {
|
||||||
setUserEmail?.(email);
|
setUserEmail?.(email);
|
||||||
}
|
}
|
||||||
|
}, [setUserEmail, response, email]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
// Capture user email before unmounting
|
// Capture user email before unmounting
|
||||||
getAuthAction().then(auth =>
|
getAuthAction().then(auth =>
|
||||||
setUserEmail?.(auth?.user?.email ?? undefined));
|
setUserEmail?.(auth?.user?.email ?? undefined));
|
||||||
};
|
};
|
||||||
}, [setUserEmail, response, email]);
|
}, [setUserEmail]);
|
||||||
|
|
||||||
const isFormValid =
|
const isFormValid =
|
||||||
email.length > 0 &&
|
email.length > 0 &&
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user