feat: refactor authentication forms to use <form> elements for better submission handling

This commit is contained in:
shuaiplus
2026-03-15 18:26:36 +08:00
parent 722d3db0e9
commit 171f3c5d71
4 changed files with 172 additions and 134 deletions
+8 -3
View File
@@ -92,7 +92,12 @@ export default function PublicSendPage(props: PublicSendPageProps) {
{loading && <p className="muted">{t('txt_loading')}</p>}
{!loading && needPassword && (
<>
<form
onSubmit={(e) => {
e.preventDefault();
void loadSend(password);
}}
>
<label className="field">
<span>{t('txt_password')}</span>
<div className="password-wrap">
@@ -104,10 +109,10 @@ export default function PublicSendPage(props: PublicSendPageProps) {
/>
</div>
</label>
<button type="button" className="btn btn-primary full" disabled={busy} onClick={() => void loadSend(password)}>
<button type="submit" className="btn btn-primary full" disabled={busy}>
<Lock size={14} className="btn-icon" /> {t('txt_unlock_send')}
</button>
</>
</form>
)}
{!loading && sendData && (