I am using Devise for authentication in my rails app. There are two devise models in the app, admin
and customer
.
Customer model uses mobile_number
for authentication instead of the usual email_id field. However, the admin field uses email_id
for authentication.
Now, the issue I am facing is related to the default flash messages shown by devise.
Consider, when a user enters invalid login credentials, the message is
'Invalid email or password'
I want to customize this message based on models. So, if admin enters incorrect credentials, message is:
'Invalid email or password'
If customer enters the same, it is:
'Invalid mobile number or password'