Class: CommandTower::Me::PasswordController

Inherits:
ApplicationController show all
Includes:
Auth::AuthenticationBoundary, Auth::AuthorizationBoundary
Defined in:
app/controllers/command_tower/me/password_controller.rb

Constant Summary

Constants inherited from ApplicationController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

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

Instance Method Details

#updateObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/command_tower/me/password_controller.rb', line 12

def update
  deserialized = CommandTower::Deserializers::Me::ChangePasswordDeserializer.call(params)
  return render_deserializer_errors unless deserialized.success?

  result = CommandTower::Workflows::Me::ChangePasswordWorkflow.call(
    current_user: current_user,
    current_password: deserialized.input.current_password,
    password: deserialized.input.password,
    password_confirmation: deserialized.input.password_confirmation
  )
  render_application_result(result)
end