-
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
Issues using devise and devise_token_auth #159
Comments
@davegreco - You need to set the "provider" param to "email" if you're using the devise gem with the devise token database. Let me know how that works for you! |
In regards to the "wrong number of arguments (1 for 0)" error, I managed to fix the issue by moving Example: app/controllers/api/base_controller.rb
config/routes.rb
|
In regards to the "uid can't be blank" error, just add the following to the user model: app/models/user.rb
|
@ACPK is right - the The solution that @vic700208 will work as well unless you're using OmniAuth, in which case it will cause problems. |
When I attempt to perform a sign up using devise I get the error "uid can't be blank" when validating the creation of a new user. I suspect that this is due to me being forced to use omniauth. I included the omniauth gem in order to get the project to even compile, the instructions for excluding it do not appear to work. Does devise handle registrations differently than devise_token_auth when it comes to registering? I even tried adding :omniauthable to my user model. What is supposed to happen when you register with just a username and a password when :omniauthable is set? Everything that I'm seeing indicates that you should be able to, does devise_token_auth force a uid to be present where devise would not? Do I need to modify the devise controller to populate uid with the e-mail or something? Any help here would be greatly appreciated, the gem looks very promising compared to alternative solutions but unfortunately I need devise to work normally in it's own /users namespace for the admin part of this site and the /auth to work with in my /api namespace for a mobile app to interface with (which it appears to nicely) but it renders the admin site useless as you can't register or sign in using the devise gem. I understand that this is supported by the community so mileage may vary but if anyone has input I could use it ASAP.
Also, when using both devise and devise_token_auth user_signed_in? in a template results in the following error:
ArgumentError in Devise::Registrations#create
Showing /.../app/views/shared/_header.erb where line #31 raised:
wrong number of arguments (1 for 0)
user_signed_in? works on every other controller other than devise controllers, the same happens at #new
The text was updated successfully, but these errors were encountered: