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

Cannot Edit user (undefined method `update_with_password') #266

Open
valentin2105 opened this issue Dec 4, 2020 · 0 comments
Open

Cannot Edit user (undefined method `update_with_password') #266

valentin2105 opened this issue Dec 4, 2020 · 0 comments

Comments

@valentin2105
Copy link

valentin2105 commented Dec 4, 2020

Hello,

I have followed the wiki, https://github.com/cschiewek/devise_ldap_authenticatable/wiki
Everything run fine, I can reach my user, email, uid, and it create the record in the DB if doesn't exist.

I dont want my app to be able to change password in my LDAP, so I setup config.ldap_update_password = false.

My issue is when I edit my user (/users/edit), I have some custom field that I setup (which work previously on classic devise with DB),

-> I don't change email or password,
-> and when I confirm my actual password (or not) I got this error :

NoMethodError (undefined method `update_with_password' for #<User:0x00007fa42eb14cf0>
Did you mean?  updated_at_was):

I have to add this to make a workaround, (model/user.rb) :

  def update_with_password(params)
    @current_password = params[:current_password]
    @new_password = params[:password]
    update_attributes(params)
  end

And I had to delete all passwords field from the devise/registrations/edit.html.erb to be able the edit users.
I hope it can help people.

Thanks for this libs !

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

1 participant