userService = $userService; $this->tokenService = $tokenService; } public function getMethods() { return ['POST', 'PUT']; } public function getUrl() { return '/api/finish-password-reset/:tokenName'; } public function work($args) { $token = $this->tokenService->getByName($args['tokenName']); return ['newPassword' => $this->userService->finishPasswordReset($token)]; } }