mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
Merge pull request #8710 from artoscinote/ma_SCI_12091
Fix password reset for core [SCI-12091]
This commit is contained in:
commit
9d6dc62592
1 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue