Out of the box, the devise gem asks for a user’s email address and uses that to sign in (authenticate).
This railscast, “Customizing Devise”, describes clearly how one can authenticate with a username in lieu of an email. How would one configure devise to try to authenticate against two different columns, either username OR email?
You just need define the method find_for_database_authentication(conditions). By example, with monogid I do that :