sessionGuard = $sessionGuard; $this->updateService = $updateService; } /** * Get's information about the currently authenticated user. * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function index(Request $request): array { return $this->fractal->item($request->user()) ->transformWith($this->getTransformer(AccountTransformer::class)) ->toArray(); } /** * Update the authenticated user's email address. * * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function updateEmail(UpdateEmailRequest $request): JsonResponse { $this->updateService->handle($request->user(), $request->validated()); return $this->returnNoContent(); } /** * Update the authenticated user's password. All existing sessions will be logged * out immediately. * * @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function updatePassword(UpdatePasswordRequest $request): JsonResponse { $this->updateService->handle($request->user(), $request->validated()); $this->sessionGuard->logoutOtherDevices($request->input('password')); return $this->returnNoContent(); } }