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

Gem overrides deprecated reset_password!, not active reset_password #217

Open
leonsp opened this issue Nov 25, 2015 · 2 comments
Open

Gem overrides deprecated reset_password!, not active reset_password #217

leonsp opened this issue Nov 25, 2015 · 2 comments

Comments

@leonsp
Copy link

leonsp commented Nov 25, 2015

The current Devise password reset process does not work in devise_ldap_authenticatable because Devise now uses reset_password but devise_ldap_authenticatable only overrides reset_password!

As an end user, I can work around by adding this to my user model:

    def reset_password(new_password, new_password_confirmation)
      if new_password == new_password_confirmation && ::Devise.ldap_update_password
        Devise::LDAP::Adapter.update_password(login_with, new_password)
      end
      clear_reset_password_token if valid?
      save
    end
@w-A-L-L-e
Copy link

Thanks this helped me out. Doing this seems shorter/future proof (until the actual fix is in as reset_password! method might have changed between your post in 2015 and now ;) ):

def reset_password(new_password, new_password_confirmation)
    reset_password!(new_password, new_password_confirmation)
 end

This makes the password forget functional again but on my setup however the ldap password is not yet actually changed (it does create a session + logs in properly after giving pass+confirmation with above fix but when doing a logout/login only the old password works). In server logs I see LDAP Error 32: No such object so I'll need to investigate further to get this working completely.

@raucao
Copy link

raucao commented Nov 10, 2020

Just FYI: This is still the case, and the fixes still work.

For me, it also updates LDAP passwords when resetting them. (I'm using the password builder config to ensure the exact format our setup requires.)

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

3 participants