Skip to content

Use email only for login/registration #192

Answered by kenjis
KipchirchirIan asked this question in Q&A
Discussion options

You must be logged in to vote

I've not tried, but how about this?

  1. remove username in the config.

    shield/src/Config/Auth.php

    Lines 216 to 223 in 44901bc

    * Valid login fields
    * --------------------------------------------------------------------
    * Fields that are available to be used as credentials for login.
    */
    public array $validFields = [
    'email',
    'username',
    ];
  2. remove username in the HTML form in src/Views/register.php.
  3. remove username validation rule in RegisterController.
  4. customize the login form.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@KipchirchirIan
Comment options

@MGatner
Comment options

Answer selected by kenjis
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@datamweb
Comment options

@genio
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #144 on May 31, 2022 21:09.