mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-07-11 19:46:22 +02:00
Refactor array definition in 'authenticateUserInternal'
This commit is contained in:
@ -613,6 +613,8 @@ final class Auth extends UserManager {
|
|||||||
* @throws AuthError if an internal problem occurred (do *not* catch)
|
* @throws AuthError if an internal problem occurred (do *not* catch)
|
||||||
*/
|
*/
|
||||||
private function authenticateUserInternal($password, $email = null, $username = null, $rememberDuration = null) {
|
private function authenticateUserInternal($password, $email = null, $username = null, $rememberDuration = null) {
|
||||||
|
$columnsToFetch = [ 'id', 'email', 'password', 'verified', 'username', 'status' ];
|
||||||
|
|
||||||
if ($email !== null) {
|
if ($email !== null) {
|
||||||
$email = self::validateEmailAddress($email);
|
$email = self::validateEmailAddress($email);
|
||||||
|
|
||||||
@ -620,7 +622,7 @@ final class Auth extends UserManager {
|
|||||||
try {
|
try {
|
||||||
$userData = $this->getUserDataByEmailAddress(
|
$userData = $this->getUserDataByEmailAddress(
|
||||||
$email,
|
$email,
|
||||||
[ 'id', 'email', 'password', 'verified', 'username', 'status' ]
|
$columnsToFetch
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if there is no user with the specified email address
|
// if there is no user with the specified email address
|
||||||
@ -640,7 +642,7 @@ final class Auth extends UserManager {
|
|||||||
try {
|
try {
|
||||||
$userData = $this->getUserDataByUsername(
|
$userData = $this->getUserDataByUsername(
|
||||||
$username,
|
$username,
|
||||||
[ 'id', 'email', 'password', 'verified', 'username', 'status' ]
|
$columnsToFetch
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if there is no user with the specified username
|
// if there is no user with the specified username
|
||||||
|
Reference in New Issue
Block a user