userSession = $userSession; $this->storage = $storage; } /** * @return JSONResponse */ #[NoAdminRequired] #[PasswordConfirmationRequired] public function createCodes(): JSONResponse { $user = $this->userSession->getUser(); $codes = $this->storage->createCodes($user); return new JSONResponse([ 'codes' => $codes, 'state' => $this->storage->getBackupCodesState($user), ]); } }