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)

32 lines (30 loc) 1.06 kB
import ClientAPICall from "../../../../functions/createAppCall"; /** * Updates the password of 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.current_password - The current password for confirmation. * @param {string} options.new_password - The new password to set. * @returns {Promise<any>} - API response confirming password update. * * @throws {Error} - Throws an error if the API request fails. */ export default async function updatePassword(options: { apiKey: string; panel: string; current_password: string; new_password: string; }): Promise<any> { return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "PUT", endpoint: "account/password", body: { current_password: options.current_password, password: options.new_password } }); }