This simple Drupal 8 module allows users to log in exclusively with their email address from the standard login form.

The difference between this module and the other ones is that you cannot login using your username with this module.

Project link

https://www.drupal.org/project/login_onlyemail

Git instructions

git clone --branch 8.x-1.x https://git.drupal.org/project/login_onlyemail.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-login_onlyemai...

Comments

aabramos created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes
Issue tags: -user login

Thank you for your contribution! Remember to change status of this issue when the project is ready to be reviewed. The current status is telling the reviewer to wait.

aabramos’s picture

Status: Active » Needs review
aabramos’s picture

Oh, sorry about that, it's my first time here.

ppaliya’s picture

@aabramos: I was reviewing the code and I found that in .module file the code block of "// Block loading by username." has some indentation issues.

aabramos’s picture

@ppaliya PAReview only passed the tests indented in this weird way. I'll try to make it look better.

aabramos’s picture

@ppaliya @kiamlaluno Corrected the indentation.

laboratory.mike’s picture

Interesting module! Concerning functionality, the module works as expected, and alters the user login form to accept email only.

I've tried installing and using it, and here are the issues I have found:

When I tried installing the module, I got the error "Missing required keys (core) in sites/flashpoint.ceriumsoft.com/modules/custom/login_onlyemail/login_onlyemail.info.yml" . Adding "core: 8.x" to the info.yml file fixed it.

Next, it looks like \Drupal::url() is a deprecated function (the PHPStorm editor program highlights function deprecation). This is on Line 40. The updated version, which accomplishes the same, is to add:

use Drupal\Core\Url;

... 

':password' => URL::fromRoute('user.pass', [], ['query' => ['name' => $name_input]])->toString(),

After this, I noticed that if someone uses their username, the error message is "Unrecognized username or password. Forgot your password?" This would not indicate that we are using an email-only form. You may want to change this to make it clearer that the person is being denied access because they are not using their email.

Finally, this last observation might not be an issue, but should cases where someone uses a username, and not a password, trigger an entry into the flood table? I tried entering a bad username and correct username with bad password, and these attempts were logged to the flood table, as expected. If a correct username/password should be blocked, but with no addition to the flood table, then the module works as expected.

laboratory.mike’s picture

Status: Needs review » Needs work
aabramos’s picture

Status: Needs work » Needs review

Hello @laboratory.mike

Thanks for all your great suggestions! I updated the module to the version 8.x-1.3, so take a look.

alexdmccabe’s picture

Hi @aabramos,

Your pareview is indeed clean (except for a minor complaint about no tests)! I tested it out, and everything seems to be working.

I really like the soft dependency on Markdown that you set up in login_onlyemail_help(), I tried installing the Markdown module and it appears to work well.

I only have a few minor issues:

  1. In the docblock for login_onlyemail_help(), the @inheritdoc line is unnecessary - it should:
    1. Be the only line in the docblock
    2. Have {} wrapped around the @inheritdoc tag

    See the documentation for inheritdoc.

  2. In your README.md, every header is supposed to be followed by one blank line, and every header except the first is supposed to have two blank lines before it. This does not seem to be applied correctly. This is according to the summary at the end of the README template page.
  3. In login_onlyemail_help(), you use file_get_contents(dirname(__FILE__) . '/README.md'). You could replace this with file_get_contents(__DIR__ . '/README.md').

Other than that, I think this looks really good!

alexdmccabe’s picture

Status: Needs review » Reviewed & tested by the community
avpaderno’s picture

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.