Merge pull request #8710 from artoscinote/ma_SCI_12091

Fix password reset for core [SCI-12091]
This commit is contained in:
Martin Artnik 2025-07-24 15:57:23 +02:00 committed by GitHub
commit 9d6dc62592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,9 +5,19 @@ class Users::PasswordsController < Devise::PasswordsController
# end
# POST /resource/password
# def create
# super
# end
def create
self.resource = resource_class.send_reset_password_instructions(resource_params)
yield resource if block_given?
if resource.errors.added?(:email, :blank)
flash.now[:alert] = I18n.t('devise.errors.email.empty')
self.resource = resource_class.new
render :new
else
set_flash_message!(:notice, :send_instructions)
respond_with({}, location: after_sending_reset_password_instructions_path_for(resource_name))
end
end
# GET /resource/password/edit?reset_password_token=abcdef
# def edit