-
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: Using acts_as_token_authentication_handler_for in the base controller: how do I create exceptions? (R: :only/:except options are supported) #53
Comments
So I've commented out this line and now I can use :authenticate_whatever at my own will through the controllers. But thinking that this use-case does not apply to anyone else makes me think what I'm doing wrong... |
@lfglopes unfortunately, this is because the actual filter getting registered is the @gonzalo-bulnes I'm curious to why you do not allow the user to be responsible for injecting these filters? This behavior forces an opt-out instead of opt-in behavior, which isn't expected coming from devise. |
Hello @lfglopes, Instead of adding |
The pull-request #61 addresses two issues which were present in this question/discussion:
Since the second topic was discussed in #49 (and will be solved soon thanks to #61), I suggest we focus this issue topic on the first point: the possibility to create exceptions when using A possible implementation was submitted by @donbobka in #61, which, I think, could be improved. Comments would be welcome about which syntax (for usage) you would expect the option to have! |
I propose replace parameter Possible usages: # Only specified actions
acts_as_token_authentication_handler_for User, only: [:actions, :with, :token, :auth]
# All actions except specified actions
acts_as_token_authentication_handler_for User, except: [:actions, :without, :token, :auth]
# Manual mode
acts_as_token_authentication_handler_for User, only: :none
before_filter :authenticate_entity_from_token!, only: [:actions, :with, :token, :auth] |
Hi @donbobka, Yes, I think that's a much better syntax. I like the |
PR #62 |
Using the devise way I can do
skip_before_filter :authenticate_user!, :except => [:update, :you_have_to_be_logged, :yadayada]
But if I put acts_as_token_authentication_handler_for on my base controller these "skip" operations have no effect and all my app becomes locked. How do I override these?
The text was updated successfully, but these errors were encountered: