-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Find User by email and extra attributes #311
Comments
@diegossilveira did you ever figure out a path forward? Looking at some similar multi-tenant issues where user email may be tied to multiple tenants and trying to figure this out. Is an alternate approach potentially to add a tenant_name as an extra field in the token? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
We have an application that uses devise_token_auth to accomplish token based authentication features. A new feature requires that we must have multiple users with the same email address in our database with an extra attribute that put each user in a different scope: something like a
tenant_id
.Looking at devise_token_auth code, we figured out that the only way to customize User search query is to override
sessions_controller.rb
:I believe a better approach is to define a method on the model (authentication subject) by convention and pass it all the parameters from the controller, so the query could be easily customizable. A default implementation of this method (with the current query) could be supplied on
DeviseTokenAuth::Concerns::User
.Is there a good reason for not doing so?
The text was updated successfully, but these errors were encountered: