From 5072db5e2abb2b1b3ac5358ea67e677d0e060137 Mon Sep 17 00:00:00 2001 From: Alex Orosciuc Date: Fri, 6 Jun 2025 11:59:56 +0100 Subject: [PATCH] Add support for "required" validation message --- components/Account.php | 3 +++ lang/en/lang.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/components/Account.php b/components/Account.php index 80c267d..7733117 100644 --- a/components/Account.php +++ b/components/Account.php @@ -205,6 +205,9 @@ public function onSignin() $messages['login'] = $this->loginAttribute() == UserSettings::LOGIN_USERNAME ? trans('winter.user::lang.account.invalid_username') : trans('winter.user::lang.account.invalid_email'); + $messages['login.required'] = $this->loginAttribute() == UserSettings::LOGIN_USERNAME + ? trans('winter.user::lang.account.required_username') + : trans('winter.user::lang.account.required_email'); if (!array_key_exists('login', $data)) { $data['login'] = post('username', post('email')); diff --git a/lang/en/lang.php b/lang/en/lang.php index 3543815..8020841 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -180,6 +180,8 @@ 'invalid_current_pass' => 'The current password you entered was invalid.', 'invalid_username' => 'The username you have entered is invalid.', 'invalid_email' => 'The email address you have entered is invalid.', + 'required_username' => 'The username field is required.', + 'required_email' => 'The email address field is required.', 'success_activation' => 'Successfully activated your account.', 'success_deactivation' => 'Successfully deactivated your account. Sorry to see you go!', 'success_saved' => 'Settings successfully saved!',