UNPKG

pterodactyl-api-wrapper

Version:

[![NPM version](https://img.shields.io/npm/v/pterodactyl-api-wrapper.svg)](https://npmjs.com/package/pterodactyl-api-wrapper) [![License](https://img.shields.io/npm/l/pterodactyl-api-wrapper.svg)](LICENSE)

27 lines (25 loc) 914 B
import ClientAPICall from "../../../../functions/createAppCall"; /** * Disables Two-Factor Authentication (2FA) for the authenticated user. * * @param {Object} options - API call options. * @param {string} options.apiKey - The API key for authentication. * @param {string} options.panel - The base URL of the Pterodactyl panel. * @param {string[]} options.tokens - An array of 2FA recovery codes to confirm disabling. * @returns {Promise<any>} - API response confirming 2FA deactivation. * * @throws {Error} - Throws an error if the API request fails. */ export default async function twoFactorDisable(options: { apiKey: string; panel: string; tokens: string[]; }): Promise<any> { return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", endpoint: "account/two-factor", body: { tokens: options.tokens } }); }