I have a Devise SessionController like :
class SessionsController < Devise::SessionsController
# Respond only with json, no html
respond_to :json
end
When the user give a bad login/password the response is a string from i18n file devise.en.yml
Invalid email or password.
I would like to have something like other validations errors
{
"errors" : {
"message" : "Invalid email or password"
}
}
EDIT I found a solution by creating a custom failure app but I think Devise can do it without this custom failure, Right ?