add reset password link

This commit is contained in:
Pete Matsyburka
2025-09-06 11:10:45 +03:00
parent 1245ff2cce
commit 4dc6149530
8 changed files with 35 additions and 13 deletions
+6
View File
@@ -20,4 +20,10 @@ class PasswordsController < Devise::PasswordsController
Current.user = resource
end
end
private
def after_resetting_password_path_for(_)
new_session_path(resource_name)
end
end
+1
View File
@@ -30,6 +30,7 @@ class UsersController < ApplicationController
return render turbo_stream: turbo_stream.replace(:modal, template: 'users/new'), status: :unprocessable_content
end
@user.password = SecureRandom.hex if @user.password.blank?
@user.role = User::ADMIN_ROLE unless role_valid?(@user.role)
if @user.save
@@ -14,7 +14,7 @@ class UsersSendResetPasswordController < ApplicationController
@user.send_reset_password_instructions
redirect_back fallback_location: settings_users_path,
notice: I18n.t('you_will_receive_an_email_with_password_reset_instructions_in_a_few_minutes')
notice: I18n.t('an_email_with_password_reset_instructions_has_been_sent')
end
end
end