In afterValidate method I am encrypting the password for storing in database and it’s working fine. I have created a separate form for changing password with only 2 fields, e.g. password and password_repeat and another form for rest of the user profile. Password change also works fine.
Problem comes when I edit the user profile using the other form. When changes are saved, it goes to afterValidate and again encrypts the password so user can’t log in after editing the profile. I want to ensure that password is encrypted only during registration and password change. It should be left along in case user only edits profile. User profile editing form doesn’t have password fields.
Any help would be highly appreciated.