fix: reset turnstile on login error handling

This commit is contained in:
2026-01-11 18:54:23 -05:00
parent 14bbd9c762
commit 1da88dba4e
@@ -69,13 +69,13 @@
window.location.href = '/'; window.location.href = '/';
} else { } else {
const resData = await res.json(); const resData = await res.json();
if (window.turnstile) {
window.turnstile.reset();
}
if (resData.errors) { if (resData.errors) {
const messages = Object.values(resData.errors).flat(); const messages = Object.values(resData.errors).flat();
error = messages.join('\n'); error = messages.join('\n');
} else { } else {
if (window.turnstile) {
window.turnstile.reset();
}
if (resData.message === 'TOTP code is required.') { if (resData.message === 'TOTP code is required.') {
totpEnabled = true; totpEnabled = true;
} }