fix: Move the 'Back to logic' link outside the <form/>.

Moving the URL from the form to avoid any unnecessary form validation.
Refs #10037
This commit is contained in:
Ashesh Vashi
2026-06-17 15:07:48 +05:30
parent 660ecf2113
commit 3660d19535
2 changed files with 6 additions and 6 deletions
@@ -21,10 +21,10 @@ export default function ForgotPasswordPage({csrfToken, actionUrl, loginUrl, ...p
<InputText name="email" value={form.email} onChange={(v)=>onTextChange('email', v)} placeholder={gettext('Email Address')} autoFocus
controlProps={{autoComplete: null}} />
<SecurityButton name="internal_button" value="Recover Password" disabled={!form.email}>{gettext('Recover Password')}</SecurityButton>
{loginUrl && <Box textAlign="center">
<a style={{color: 'inherit'}} href={loginUrl}>{gettext('Back to login')}</a>
</Box>}
</form>
{loginUrl && <Box textAlign="center">
<a style={{color: 'inherit'}} href={loginUrl}>{gettext('Back to login')}</a>
</Box>}
</BasePage>
);
}
@@ -22,10 +22,10 @@ export default function PasswordResetPage({csrfToken, actionUrl, loginUrl, ...pr
<InputText name="password_confirm" value={form.password_confirm} onChange={(v)=>onTextChange('password_confirm', v)} type="password" placeholder={gettext('Retype Password')}
controlProps={{autoComplete: 'new-password'}} />
<SecurityButton value="Reset Password">{gettext('Reset Password')}</SecurityButton>
{loginUrl && <Box textAlign="center">
<a style={{color: 'inherit'}} href={loginUrl}>{gettext('Back to login')}</a>
</Box>}
</form>
{loginUrl && <Box textAlign="center">
<a style={{color: 'inherit'}} href={loginUrl}>{gettext('Back to login')}</a>
</Box>}
</BasePage>
);
}