-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recall method is not being called in warden.authenticate! #3142
Comments
Can you please provide a sample application that reproduces the error? |
Hi @lucasmazza Here is the sample app: https://github.com/lcguida/devise_teste There's an existing user:
If you try to login with these credentials you'll receive a console.log with the following json response:
If you use any other credentials, the app should respond with:
But instead, is responding with 401 and the default devise message:
|
Recall is invoked just in some situations, it is not supposed to be a generic mechanism. I think it only does so for navigational requests (so it doesn't really work for API requests). |
I am having the exact opposite issues ; i cant get the standard devise messages to show |
I am closing this. As said previously, recall is not invoked for API requests, only for navigational ones. If you want to customise the http status code, you will have better luck doing so at the failure app level. |
@leofrozenyogurt feel free to open up an issue for the problem you are seeing. Please include as much information as possible to reproduce the issue! |
Wow, looking at the Devise |
Hi,
I searched around, posted in stackoverflow, but I got no solution so far.
I'm trying to give a custom json response in case of failed login. I want the json to be in this format:
So I overrode the SessionsContoller, as following:
routes.rb:
devise.rb:
Login is working just fine, I'm just not being able to override the failure response. I'm just posting this here to check if it's not a bug, since this same code is presented in various blog posts in the internet.
The text was updated successfully, but these errors were encountered: