fix(web): add client-side email/password validation on login (#28562)

Firefox suppresses HTML5 validation tooltips for type=email inputs on
non-HTTPS pages, leaving users with no feedback when they submit an
invalid or empty email address. Add explicit client-side checks in
handleLogin before the API call so every browser shows a clear error
message in the Alert banner.
pull/28716/head
Alexander Chen 2026-05-30 13:58:32 -07:00
parent c42cea5ca9
commit 7f84ecad9a
2 changed files with 10 additions and 0 deletions

View File

@ -1027,6 +1027,7 @@
"editor_rotate_left": "Rotate 90° counterclockwise",
"editor_rotate_right": "Rotate 90° clockwise",
"email": "Email",
"email_required": "Email is required",
"email_notifications": "Email notifications",
"empty_folder": "This folder is empty",
"empty_trash": "Empty trash",

View File

@ -78,6 +78,15 @@
});
const handleLogin = async () => {
if (!email || !email.includes('@')) {
errorMessage = email ? $t('errors.incorrect_email_or_password') : $t('email_required');
return;
}
if (!password) {
errorMessage = $t('password_required');
return;
}
try {
errorMessage = '';
loading = true;