Skip to content

Support for custom login credentials #334

@datamweb

Description

@datamweb

Hi all,
When we create a custom column in table users, for example phone_number.
And then we set the value to

    /**
     * --------------------------------------------------------------------
     * Valid login fields
     * --------------------------------------------------------------------
     * Fields that are available to be used as credentials for login.
     */
    public array $validFields = [
      //  'email',
        //'username',
        'phone_number',
    ];

It is not possible to log into the system. If there should be no problem to login.

We need to make some changes in this area.

$idType = (! isset($credentials['email']) && isset($credentials['username']))
? self::ID_TYPE_USERNAME
: self::ID_TYPE_EMAIL_PASSWORD;
$this->loginModel->recordLoginAttempt(
$idType,
$credentials['email'] ?? $credentials['username'],
$success,

Do you agree?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions