Here is a simple method for allowing users to log in with either their username or their email address.
This process allows the user to log in using either their username or their email address. It’s not difficult to implement and leaves you with a clean process where you don’t have to worry about what to do when users change their email address.