Authentication setup - no password confirmation after password recovery

I am using Devise authentication gem with Rails.

How to display a message from devise.en.yml:

send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes'

after password recovery an email was sent, but not redirected to the root site?

Update:

I found an interesting piece of code in devise_controller.rb:

def successfully_sent?(resource)
  notice = if Devise.paranoid
    resource.errors.clear
    :send_paranoid_instructions
  elsif resource.errors.empty?
    :send_instructions
  end

  if notice
    set_flash_message :notice, notice if is_navigational_format?
    true
  end
end

Setting the control points shows that invoked the right lines, : send_instructions assigned notification , called set_flash_message, but I do not see the result of all this, because I am immediately redirected to the root path.

+3
source share
1 answer

PasswordsController: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/passwords_controller.rb#L42

PasswordsController , Devise:: PasswordsController, after_sending_reset_password_instructions_path_for (resource_name)

class PasswordsController < Devise::PasswordsController
  protected
  def after_sending_reset_password_instructions_path_for(resource_name)
    #return your path
  end
end

devise_for :users, :controllers => { :passwords => "passwords" }
+7

All Articles