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

NoMethodError (undefined method `[]=' for nil:NilClass) #178

Closed
Timboh56 opened this issue Mar 11, 2015 · 4 comments
Closed

NoMethodError (undefined method `[]=' for nil:NilClass) #178

Timboh56 opened this issue Mar 11, 2015 · 4 comments

Comments

@Timboh56
Copy link

Hi friend. I am getting this error when I attempt to register a user with an email address.

NoMethodError (undefined method `[]=' for nil:NilClass):
  /Users/thui/.rvm/gems/ruby-1.9.3-p392/bundler/gems/devise_token_auth-703a511a3a9b/app/controllers/devise_token_auth/registrations_controller.rb:39:in `create'

I am using the Mongoid branch from devise token auth. It appears like the create function within RegistrationsController is trying to set the token field of resource, which is also strange, because tokens is a text field (should be a hash field it appears). Correct me if I am wrong.

@resource.tokens[@client_id] = {
              token: BCrypt::Password.create(@token),
              expiry: (Time.now + DeviseTokenAuth.token_lifespan).to_i
            }
@nicolas-besnard
Copy link
Contributor

How do you create your user ?

@Timboh56
Copy link
Author

Hi! I am using ng-token-auth from https://github.com/lynndylanhurley/ng-token-auth on angular and calling $auth.submitRegistration as described here https://github.com/lynndylanhurley/ng-token-auth#authsubmitregistration.

@Timboh56
Copy link
Author

I am on devise_token_auth (0.1.30.beta3)

working off this branch/repository
remote: git://github.com/ybian/devise_token_auth.git

I am using Mongoid, MongoDB

@zachfeldman
Copy link
Contributor

Hi there @Timboh56 ,

In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!

If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.

Hope all is well.

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

No branches or pull requests

3 participants