lynndylanhurley / devise_token_auth

Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Do What The F*ck You Want To Public License
3.52k stars 1.14k forks source link

resource_class wrong number of arguments (1 for 0) #268

Closed casertap closed 1 week ago

casertap commented 9 years ago

error_devise_token_auth

This error happens when I try to connect with facebook. I am really imitating the devise_token_auth_demo app so I do nothing fancy.

Thanks,

casertap commented 9 years ago

Anyone?

nicolas-besnard commented 9 years ago

You should avoid to create issue each time you get an error. You should also describe the steps you do to try to solve your issue.

casertap commented 9 years ago

I have progressed a little on this issue. I have opened an issue on the paper_trail gem because it is this gem that is calling the current_user during the initialization of the omniauth authentication.

https://github.com/airblade/paper_trail/issues/548

Thanks, guys. I think whose issues are relevant.

ArneZsng commented 8 years ago

I am currently having the same issue. I am still researching but I am using it together with ActiveAdmin and it seems to me that ActiveAdmin overrides the resource_class method with its own implementation when calling it from an ActiveAdmin controller.

Thus, I would suggest renaming the method "resource_class" to something more unique, e.g. resource_klass. Would you accept a pull request for that change?

ajahongir commented 7 years ago

Having same issue, It seams it conflicts with inhereted_resource/

gavin1818 commented 6 years ago

I have the same issue, the reason is that the method name "resource_class" conflicts with the method in Devise, hence instead of calling the set_user_b_token#resource_class, it calls the devise's app/controllers/devise_controller.rb#resource_class

MaicolBen commented 1 week ago

I will close for now since I don't want to break people's overrides in resource_class, please comment if this still happening