-
Notifications
You must be signed in to change notification settings - Fork 240
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
Q: Authenticating two models in one controller (R: One handler each; fallback_to_devise disabled for the first.) #39
Comments
At the moment, I used a workaround where I have a different controller which logs in the partner and redirects the partner to the partner show URL. Using the It may however still be an interesting use case to allow scoping for this method, so I'll leave this open. |
Hi @silox, seems you're right about the access denied causes; I'm AFK right |
Hi @silox, I'm sorry I haven't replied to you sooner. The use case you want to implement is quite complex. In fact, my first idea in such a case would be either to treat "User" and "Partner" as roles with a single On the other hand, it should be possible to allow passing the A third way could be allowing to disable, through an initializer option, the |
Hi @silox, taking about making the Regards! |
👍 |
Hi, keep an eye on #66. |
Since v1.5.0 the #66 feature is implemented and examples can be found in the Installation section of the |
I have a use case where I have two models: a Devise-CAS-authenticated User and a token-authenticated Partner. The user should be able to crud partners, while a partner is only allowed to show his page and post to a custom controller action.
I was thinking something along the lines of:
The problem here however is that when I navigate as an authenticated User to the index method, my access gets denied. This is because (correct me if I'm wrong) the
acts_as_token_authentication_handler
already includes thebefore_action authenticate_partner!
as a fallback if the token authentication fails, causing the authentication to fail, and throwing the 403 error.Is there a way around this or is it possible to restrict the
acts_as_token_authentication_handler
to certain controller actions?Thanks in advance.
The text was updated successfully, but these errors were encountered: