Files
client_panel/app/components/Pterodactyl/helpers.tsx

23 lines
563 B
TypeScript

export default function helpers(pterodactyl: any) {
return {
// helper what return auth header
async authHeader() {
return {
Authorization: `Bearer ${pterodactyl.api_key}`,
"Content-Type": "application/json",
Accept: "Application/vnd.pterodactyl.v1+json",
};
},
// setter for api key
async setApiKey(apiKey: string) {
return (pterodactyl.api_key = apiKey);
},
// setter for server id
async setServerID(serverID: string) {
return (pterodactyl.server_id = serverID);
},
};
}