Class: CommandTower::Auth::PasswordReset::SendController

Inherits:
CommandTower::ApplicationController show all
Includes:
CommandTower::Api::DeserializerFailureDetails, CommandTower::Auth::PasswordRecoverySessionBoundary
Defined in:
app/controllers/command_tower/auth/password_reset/send_controller.rb

Constant Summary

Constants inherited from CommandTower::ApplicationController

CommandTower::ApplicationController::AUTHENTICATION_EXPIRE_HEADER, CommandTower::ApplicationController::AUTHENTICATION_HEADER, CommandTower::ApplicationController::AUTHENTICATION_WITH_RESET

Instance Method Summary collapse

Methods inherited from CommandTower::ApplicationController

#authenticate_user!, #authenticate_user_without_email_verification!, #authorize_user!, #current_user, #safe_boolean

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/command_tower/auth/password_reset/send_controller.rb', line 12

def create
  deserialized = CommandTower::Deserializers::Auth::PasswordReset::SendDeserializer.call(params)
  return render_send_deserializer_errors(deserialized) unless deserialized.success?

  result = CommandTower::Workflows::Auth::PasswordReset::SendWorkflow.call(
    input: deserialized.input,
    password_recovery_session: current_password_recovery_session
  )
  render_application_result(result)
end