getParsedBody(); $password = $data->password ?? null; $currentPassword = $data->currentPassword ?? null; if ( !is_string($password) || !is_string($currentPassword) ) { throw new BadRequest("No `password` or `currentPassword`."); } $this->service->changePasswordWithCheck($this->user->getId(), $password, $currentPassword); return ResponseComposer::json(true); } }