Class: StandardId::Web::ResetPassword::StartController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/standard_id/web/reset_password/start_controller.rb

Constant Summary

Constants included from RateLimitHandling

RateLimitHandling::RATE_LIMIT_STORE

Instance Method Summary collapse

Methods included from StandardId::WebAuthentication

#current_account, #current_scope_names, #current_session, #revoke_current_session!

Methods included from ControllerPolicy

all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!

Instance Method Details

#createObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/standard_id/web/reset_password/start_controller.rb', line 33

def create
  form = StandardId::Web::ResetPasswordStartForm.new(
    email: params[:email],
    reset_url_template: build_reset_url_template
  )

  if form.submit
    flash[:notice] = "If an account with that email exists, we've sent password reset instructions."
    redirect_to engine_path(), status: :see_other
  else
    flash.now[:alert] = form.errors[:email].first || "Please enter your email address"
    render :show, status: :unprocessable_content
  end
end

#showObject



29
30
31
# File 'app/controllers/standard_id/web/reset_password/start_controller.rb', line 29

def show
  # Display the password reset request form
end