From 967282e50ffdf2866274d65143eeb609c8be8a38 Mon Sep 17 00:00:00 2001 From: joseph-d Date: Tue, 3 Sep 2019 11:14:55 +0100 Subject: [PATCH] Add whitespace trimming to login I have had several instances of users trying to log in and authenticating failing because they have whitespace in their email address which is obviously difficult to see on the screen. While this is technically a case of user error, I think that adding whitespace trimming would make the login system more user friendly to less technical users. --- components/Account.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/Account.php b/components/Account.php index 3817f200..6e52f40e 100644 --- a/components/Account.php +++ b/components/Account.php @@ -204,6 +204,8 @@ public function onSignin() if (!array_key_exists('login', $data)) { $data['login'] = post('username', post('email')); } + + $data['login'] = trim($data['login']); $validation = Validator::make($data, $rules); if ($validation->fails()) {