Allow users to log in using their e-mail address.

Review Request #11474 — Created Feb. 18, 2021 and updated

Information

Review Board
5bb98da...

Reviewers

One thing that sometimes happens is that users will try to log in using their
e-mail address instead of their username, and then get confused when it doesn't
work. This is exacerbated by the fact that our sessions last a long time, so
it's often been a very long time since users had to log in.

This change makes it so that if a user logs in, and the username isn't found,
it will try to look up their user by e-mail address.

Testing done:
Logged in to my devserver using both my username and my e-mail address.

Reviewed at https://reviews.reviewboard.org/r/6103/

Trial

Checks run (2 succeeded)
flake8 passed.
JSHint passed.