improve user password reset

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2025-09-06 09:21:59 +03:00
1 parent aeea619059
commit f7be74eb73
9 files changed
+110 -12

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ class ProfileController < ApplicationController
end
def update_password
if current_user.update(password_params)
if current_user.update_with_password(password_params)
bypass_sign_in(current_user)
redirect_to settings_profile_index_path, notice: I18n.t('password_has_been_changed')
else
@@ -31,6 +31,6 @@ class ProfileController < ApplicationController
end
def password_params
params.require(:user).permit(:password, :password_confirmation)
params.require(:user).permit(:password, :password_confirmation, :current_password)
end
end