Closed sammyskills closed 1 year ago
7.4
4.2.10
develop
Windows
apache
MariaDB 10.4.18
No.
findByCredentials() returns a valid user object when the email parameter value is empty.
findByCredentials()
Do this:
$users = model(UserModel); $user = $users->findByCredentials(['email' => '']); dd($user);
This returns a valid CodeIgniter\Shield\Entities\User instance.
CodeIgniter\Shield\Entities\User
I expect null to be returned as no email address was entered in the value field.
null
However, if I add a space with the value like so: $user = $users->findByCredentials(['email' => ' ']);, I get null.
$user = $users->findByCredentials(['email' => ' ']);
Thank you for reporting. I sent a PR #548
PHP Version
7.4
CodeIgniter4 Version
4.2.10
Shield Version
develop
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
MariaDB 10.4.18
Did you customize Shield?
No.
What happened?
findByCredentials()
returns a valid user object when the email parameter value is empty.Steps to Reproduce
Do this:
This returns a valid
CodeIgniter\Shield\Entities\User
instance.Expected Output
I expect
null
to be returned as no email address was entered in the value field.Anything else?
However, if I add a space with the value like so:
$user = $users->findByCredentials(['email' => ' ']);
, I getnull
.