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/28710/head
parent
2b21b7d3ae
commit
5a00c8817b
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue