Class: Searls::Auth::RequestsPasswordResetsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/searls/auth/requests_password_resets_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#forwardable_params

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/searls/auth/requests_password_resets_controller.rb', line 11

def create
  email = params[:email].to_s.strip
  user = Searls::Auth.config.user_finder_by_email.call(email)

  if proceed_with_password_reset_request?(user)
    Searls::Auth::DeliversPasswordReset.new.deliver(
      user:,
      redirect_path: params[:redirect_path],
      redirect_subdomain: params[:redirect_subdomain]
    )
  end

  flash[:notice] = Searls::Auth.config.resolve(:flash_notice_after_password_reset_email, params)
  redirect_to searls_auth.password_reset_request_path(
    email: email,
    redirect_path: params[:redirect_path],
    redirect_subdomain: params[:redirect_subdomain]
  )
end

#showObject



7
8
9
# File 'app/controllers/searls/auth/requests_password_resets_controller.rb', line 7

def show
  render Searls::Auth.config.password_reset_request_view, layout: Searls::Auth.config.layout
end