-
Notifications
You must be signed in to change notification settings - Fork 204
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
throw :warden not always caught by failure_app #198
Comments
i'm getting hit by this when using rails' AC::Live module. appearently the issue is that, according to the rack spec, you cannot throw/catch between middlewares. i don't know how to resolve this. |
more context: rails/rails#25581 (comment)
|
Here’s what I found related to this issue: When a request is made to a controller that includes the The problem arises because the If an exception is raised in the new thread, it is configured to also raise the same exception in the parent thread. However, the |
Hi! I have a project in which there are two kinds of user and both of them are set up with devise. When the sing in fails for one kind of user (Pc), I wish to try if the credentials are correct for the other one (Tutor), since some Tutor users forget to use their specific login page. I created a custom failure app in which I recreate the call but for the other resource name. It works correctly if there is a user of type Tutor with the credentials. However, if the second attempt fails the failure app is not called again and the warden error is not caught.
I can't see why it would be called the first time but not the second. While debugging I have checked that warden.manager.config.failure_app keeps being my custom failure app through all the calls. Could anyone tell me if this is the expected behaviour? These are some key parts of the code:
What I observed is that in proxy.rb, in:
the first time, CustomFailureApp is called after
throw(:warden, opts) unless user
but on the second time it is not, it continues and leads to some other errors related to user being nil hereIf you think this is the expected behaviour an I should rather post this somewhere else like stackoverflow please say so.
Edit: I did post in on stackoverflow as well (https://stackoverflow.com/questions/66866653/throw-warden-not-always-caught-by-failure-app)
Thanks!
The text was updated successfully, but these errors were encountered: