diff --git a/resources/scripts/components/auth/ForgotPasswordContainer.tsx b/resources/scripts/components/auth/ForgotPasswordContainer.tsx index 112f04945..8672880cc 100644 --- a/resources/scripts/components/auth/ForgotPasswordContainer.tsx +++ b/resources/scripts/components/auth/ForgotPasswordContainer.tsx @@ -111,7 +111,10 @@ export default () => { sitekey={siteKey || '_invalid_key'} onVerify={(response) => { setToken(response); - submitForm(); + // Ensure submitForm is called *after* token is updated + setTimeout(() => { + submitForm(); + }, 0); }} onExpire={() => { setSubmitting(false); diff --git a/resources/scripts/components/auth/LoginContainer.tsx b/resources/scripts/components/auth/LoginContainer.tsx index 2d3a9de7f..1a3ec6736 100644 --- a/resources/scripts/components/auth/LoginContainer.tsx +++ b/resources/scripts/components/auth/LoginContainer.tsx @@ -129,7 +129,10 @@ function LoginContainer() { sitekey={siteKey || '_invalid_key'} onVerify={(response) => { setToken(response); - submitForm(); + // Ensure submitForm is called after token is updated + setTimeout(() => { + submitForm(); + }, 0); }} onExpire={() => { setSubmitting(false);