I found a way to configure the application to use a login name instead of an email address.
But actually I want to use a combination: -
Enter username or Email: <text-box> Enter your password : <text-box>
So how to achieve this?
In fact, we need to reconfigure the gem configuration to support this.
so far I know that modifying the /config/initializers/devise.rb file as
config.authentication_keys = [ :username ] (edited from email to username.)
actually allow login using username instead of email.
But can I do something like: -
config.authentication_keys = [ :username | :email] in the "config/initializers/devise.rb" file.
Thus, we can use the username or email address as an authentication key at runtime depending on the input provided by the user. Thanks in advance.
source share