-
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
Error with authentication #20
Comments
|
route is test#members_only mounted with in routes.rb I have: in user.rb I have: I just connected to the server and we already have UID in the users table from the migration |
The error If you open a rails console using |
It appears that the error was somehow caused by having: Active_admin was also using devise and I think that it somehow overwrote find_by_uid? |
That's really strange. I'll install active_admin and see if I can reproduce the bug. |
@quellhorst - I've installed active admin, but I still can't reproduce this bug. Are there any other gems that could be causing conflicts? |
@lynndylanhurley I'll look and see. |
I was facing this issue and fix by changing regenerating different user model name like AdminUser for example, and everything works fine. |
I'm recently run into the same error. With devise_token_auth (0.1.39), when trying to access a specific resource:
I checked my migrations, and I'm able to run AppUser.find_by_uid("[email protected]"), the problem shows up when I try to access index action on my vehicle resource:
This is my index action:
Any idea what might be causing Devise Token Auth to try to run 'find_by_uid' on my vehicles controller? @pedroviana 's solution didn't worked for me because my user model is called AppUser and not User... Thanks. |
@godinezb are you using active_admin? if so try to define the devise_token_auth routes before active_admin routes like `mount_devise_token_auth_for 'User', at: 'auth', controllers: { devise_for :admin_users, ActiveAdmin::Devise.config |
Hey @pedroviana thanks for replying. But I'm not using Active admin, what I'm using is Active Model Serializers, I have checked in other issues and the versions I have shouldnt be causing errors, I'm feeling really desperate at this point.. |
@godinezb I am using version 0.1.36, can you try it? |
Using this gems:
And I'm still getting the same errors:
When my controller tries to get the json response, the method 'find_by_uid' its called in a non devise_token_auth model... |
@godinezb type here the full implementation of devise_token_auth, migrations, routes, model and config file |
Sure, here are my configuration files.
Model:
Config file:
Schema:
Thanks again. |
On our app we are using your devise_token_auth but getting an exception:
[PROJECT_ROOT]/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/dynamic_matchers.rb:26:in
method_missing' NoMethodError: undefined method
find_by_uid' for #Class:0x007f6622678fd8Any idea what is the cause?
The text was updated successfully, but these errors were encountered: