Skip to content
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

Multiple authentication handler on 1 controller action not working properly #330

Open
fahmiardhianto opened this issue Mar 7, 2018 · 1 comment
Labels
support request This issue is a request for support using Simple Token Authentication.

Comments

@fahmiardhianto
Copy link

The documentation stated that

If sign-in is successful, no other authentication method will be run, but if it doesn't (the authentication params were missing, or incorrect) then Devise takes control and tries to authenticate_user! with its own modules. That behaviour can however be modified for any controller through the fallback option (which defaults to fallback: :devise).

I created a controller that allow for Admin and user to update, following the doc to use fallback: :none

acts_as_token_authentication_handler_for Admin, fallback: :none, only: [:create, :update]
acts_as_token_authentication_handler_for User, fallback: :exception, only: [:update]

This works for the User, but when I try to send a request with valid Admin authentication, it always fails. Meaning that the authentication handler for User is still called.

Can someone give me a guide for this case?

@feliperaul
Copy link

Having the exact same issue.

@gonzalo-bulnes gonzalo-bulnes added the support request This issue is a request for support using Simple Token Authentication. label Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support request This issue is a request for support using Simple Token Authentication.
Projects
None yet
Development

No branches or pull requests

3 participants