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

NameError - undefined local variable or method `set_reset_password_token' #59

Closed
ghost opened this issue Oct 29, 2014 · 8 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 29, 2014

Getting:
NameError - undefined local variable or method set_reset_password_token' for #User:0x007fa8c5c005d8:` when executing $auth.requestPasswordReset($scope.passwordResetRequestForm)

This is related to DeviseTokenAuth: devise_token_auth / app / models / devise_token_auth / concerns / user.rb

module DeviseTokenAuth::Concerns::User
extend ActiveSupport::Concern

Line 54-56
# override devise method to include additional info as opts hash
def send_reset_password_instructions(opts=nil)
token = set_reset_password_token

@lynndylanhurley
Copy link
Owner

That's strange - the method should be provided by Devise. Can you post the code that you're using to extend your User model?

@ghost
Copy link
Author

ghost commented Oct 29, 2014

User model
class User < ActiveRecord::Base include DeviseTokenAuth::Concerns::User before_create :skip_confirmation!

Also tried to add devise :recoverable to user model, but it didn't resolve the issue.

@lynndylanhurley
Copy link
Owner

@UrbanViking - I'm having trouble reproducing this. There is a demo implementation of devise_token_auth here (this is what the demo site is running). Can you please compare / contrast your app with the demo app for any notable differences?

@lynndylanhurley
Copy link
Owner

@UrbanViking - which version of Devise are you using?

@lynndylanhurley
Copy link
Owner

@UrbanViking - I think I might be using a method that was introduced in Devise 3.3, but the minimum requirement for this gem hasn't changed from 3.2. Can you try running bundle update devise and let me know if that solves the problem?

@ghost
Copy link
Author

ghost commented Oct 30, 2014

@lynndylanhurley - It worked with Devise 3.3. I had Devise 3.2.4. Do I need to have Devise in my gem file?

Please notice that that unconfirmed_email need to be available, otherwise you get a NameError.

@markusklooth
Copy link

@lynndylanhurley can we update the min devise version to 3.3, since set_reset_password_token was added in 3.3?

@lynndylanhurley
Copy link
Owner

@markusklooth - that's exactly what I'm gonna do. Thanks for helping me verify this one guys.

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

No branches or pull requests

2 participants