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

change prepend_before_action to before_action #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaspervandenberg
Copy link
Contributor

The authenticate_scope! has been prepended to the callbacks list. It is not required to prepend this function and it sometimes even breaks some functionalities because it is prepended:

We have a default scope on our resource model that sets a tenant according to the domain name (using: https://github.com/ErwinM/acts_as_tenant). Setting the tenant value required for finding the correct user is done in a prepend_before_action of our own. Because of the default scope, the `authenticate_scope! method is not able to find the correct user, because the tenant has not been set yet.

I think that changing the prepend_before_action to before_action would be better as the developer is able to change scopes and perform other actions before the user lookup is done in authenticate_scope!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant