result->status == "active") { dashboard\primary\success("Custom domain setup successfully!"); misc\mysql\query("UPDATE `apps` SET `apiCustomDomainId` = ? WHERE `secret` = ?", [$custom_domain_id, $_SESSION['app']]); } else { if($statusCode > 399) { dashboard\primary\error($json->errors[0]->message); } else { if($json->verification_errors) { dashboard\primary\error("You need to set CNAME to api-worker.keyauth.win then try again!"); } else { dashboard\primary\error("Failed to setup custom domain! Please try again"); } } ?>

Try again after waiting 1 minute

dashboard\primary\error("Hash is too short!"), 'failure' => dashboard\primary\error("Failed to add hash!"), 'success' => dashboard\primary\success("Added hash successfully!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['resethash'])) { $resp = misc\app\resetHash(); match ($resp) { 'failure' => dashboard\primary\error("Failed to reset hash!"), 'success' => dashboard\primary\success("Successfully reset hash!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if ($_SESSION['app']) { $query = misc\mysql\query("SELECT * FROM `apps` WHERE `secret` = ?", [$_SESSION['app']]); if ($query->num_rows > 0) { while ($row = mysqli_fetch_array($query->result)) { $enabled = $row['enabled']; $owner = $row['owner']; $hwidcheck = $row['hwidcheck']; $forceHwid = $row['forceHwid']; $minHwid = $row['minHwid']; $vpnblock = $row['vpnblock']; $panelstatus = $row['panelstatus']; $customDomain = $row['customDomain']; $hashcheck = $row['hashcheck']; $tokenvalidation = $row["tokensystem"]; $cooldown = $row['cooldown']; $session = $row['session']; $cooldownUnit = $row['cooldownUnit']; $sessionUnit = $row['sessionUnit']; $verr = $row['ver']; $dll = $row['download']; $webdll = $row['webdownload']; $wh = $row['webhook']; $ipLogging = $row['ipLogging']; $rs = $row['resellerstore']; $sellappwhsecret = $row['sellappsecret']; $sellappdayproduct = $row['sellappdayproduct']; $sellappweekproduct = $row['sellappweekproduct']; $sellappmonthproduct = $row['sellappmonthproduct']; $sellapplifetimeproduct = $row['sellapplifetimeproduct']; $sellixwhsecret = $row['sellixsecret']; $sellixdayproduct = $row['sellixdayproduct']; $sellixweekproduct = $row['sellixweekproduct']; $sellixmonthproduct = $row['sellixmonthproduct']; $sellixlifetimeproduct = $row['sellixlifetimeproduct']; $shoppywhsecret = $row['shoppysecret']; $shoppydayproduct = $row['shoppydayproduct']; $shoppyweekproduct = $row['shoppyweekproduct']; $shoppymonthproduct = $row['shoppymonthproduct']; $shoppylifetimeproduct = $row['shoppylifetimeproduct']; $appdisabled = $row['appdisabled']; $tokeninvalid = $row["tokeninvalid"]; $usernametaken = $row['usernametaken']; $keynotfound = $row['keynotfound']; $keyused = $row['keyused']; $nosublevel = $row['nosublevel']; $usernamenotfound = $row['usernamenotfound']; $passmismatch = $row['passmismatch']; $hwidmismatch = $row['hwidmismatch']; $noactivesubs = $row['noactivesubs']; $hwidblacked = $row['hwidblacked']; $pausedsub = $row['pausedsub']; $vpnblocked = $row['vpnblocked']; $keybanned = $row['keybanned']; $userbanned = $row['userbanned']; $sessionunauthed = $row['sessionunauthed']; $hashcheckfail = $row['hashcheckfail']; $minUsernameLength = $row['minUsernameLength']; $blockLeakedPasswords = $row['blockLeakedPasswords']; $customerPanelIcon = $row['customerPanelIcon']; $loggedInMsg = $row['loggedInMsg']; $pausedApp = $row['pausedApp']; $unTooShort = $row['unTooShort']; $pwLeaked = $row['pwLeaked']; $chatHitDelay = $row['chatHitDelay']; $enabledFunctions = $row['enabledFunctions']; $apiCustomDomainId = $row['apiCustomDomainId']; } } } if (isset($_POST['updatesettings'])) { $status = misc\etc\sanitize($_POST['statusinput']); $hwid = misc\etc\sanitize($_POST['hwidinput']); $tokenvalidation = misc\etc\sanitize($_POST["tokeninput"]); $forceHwid = misc\etc\sanitize($_POST['forceHwid']); $minHwid = misc\etc\sanitize($_POST['minHwid']); $vpn = misc\etc\sanitize($_POST['vpninput']); $hashstatus = misc\etc\sanitize($_POST['hashinput']); $ver = misc\etc\sanitize($_POST['version']); $dl = misc\etc\sanitize($_POST['download']); $webdl = misc\etc\sanitize($_POST['webdownload']); $webhook = misc\etc\sanitize($_POST['webhook']); $ipLogging = misc\etc\sanitize($_POST['ipLogging']); $resellerstorelink = misc\etc\sanitize($_POST['resellerstore']); $panelstatus = misc\etc\sanitize($_POST['panelstatus']); $customDomain = misc\etc\sanitize($_POST['customDomain']); $cooldownexpiry = misc\etc\sanitize($_POST['cooldownexpiry']); $cooldownduration = misc\etc\sanitize($_POST['cooldownduration']) * $cooldownexpiry; $sessionexpiry = misc\etc\sanitize($_POST['sessionexpiry']); $sessionduration = misc\etc\sanitize($_POST['sessionduration']) * $sessionexpiry; $minUsernameLength = misc\etc\sanitize($_POST['minUsernameLength']); $blockLeakedPasswords = misc\etc\sanitize($_POST['blockLeakedPasswords']); $appdisabledpost = misc\etc\sanitize($_POST['appdisabled']); $tokeninvalid = misc\etc\sanitize($_POST['tokeninvalid']); $usernametakenpost = misc\etc\sanitize($_POST['usernametaken']); $keynotfoundpost = misc\etc\sanitize($_POST['keynotfound']); $keyusedpost = misc\etc\sanitize($_POST['keyused']); $nosublevelpost = misc\etc\sanitize($_POST['nosublevel']); $usernamenotfoundpost = misc\etc\sanitize($_POST['usernamenotfound']); $passmismatchpost = misc\etc\sanitize($_POST['passmismatch']); $hwidmismatchpost = misc\etc\sanitize($_POST['hwidmismatch']); $noactivesubspost = misc\etc\sanitize($_POST['noactivesubs']); $hwidblackedpost = misc\etc\sanitize($_POST['hwidblacked']); $pausedsubpost = misc\etc\sanitize($_POST['pausedsub']); $vpnblockedpost = misc\etc\sanitize($_POST['vpnblocked']); $keybannedpost = misc\etc\sanitize($_POST['keybanned']); $userbannedpost = misc\etc\sanitize($_POST['userbanned']); $sessionunauthedpost = misc\etc\sanitize($_POST['sessionunauthed']); $hashcheckfailpost = misc\etc\sanitize($_POST['hashcheckfail']); $shoppywebhooksecret = misc\etc\sanitize($_POST['shoppywebhooksecret']); $shoppyday = misc\etc\sanitize($_POST['shoppydayproduct']); $shoppyweek = misc\etc\sanitize($_POST['shoppyweekproduct']); $shoppymonth = misc\etc\sanitize($_POST['shoppymonthproduct']); $shoppylife = misc\etc\sanitize($_POST['shoppylifetimeproduct']); $sellixwebhooksecret = misc\etc\sanitize($_POST['sellixwebhooksecret']); $sellixday = misc\etc\sanitize($_POST['sellixdayproduct']); $sellixweek = misc\etc\sanitize($_POST['sellixweekproduct']); $sellixmonth = misc\etc\sanitize($_POST['sellixmonthproduct']); $sellixlife = misc\etc\sanitize($_POST['sellixlifetimeproduct']); $sellappwebhooksecret = misc\etc\sanitize($_POST['sellappwebhooksecret']); $sellappday = misc\etc\sanitize($_POST['sellappdayproduct']); $sellappweek = misc\etc\sanitize($_POST['sellappweekproduct']); $sellappmonth = misc\etc\sanitize($_POST['sellappmonthproduct']); $sellapplife = misc\etc\sanitize($_POST['sellapplifetimeproduct']); $customerPanelIcon = misc\etc\sanitize($_POST['customerPanelIcon']); $loggedInMsg = misc\etc\sanitize($_POST['loggedInMsg']); $pausedApp = misc\etc\sanitize($_POST['pausedApp']); $unTooShort = misc\etc\sanitize($_POST['unTooShort']); $pwLeaked = misc\etc\sanitize($_POST['pwLeaked']); $chatHitDelay = misc\etc\sanitize($_POST['chatHitDelay']); $enabledFunctions = misc\etc\sanitize($_POST['functionValue']) ?? $enabledFunctions; if (!is_null($customDomain) && ($_SESSION['role'] == "seller" || $_SESSION['role'] == "Manager")) { if (strpos($customDomain, "http") === 0) { dashboard\primary\error("Do not include protocol. Your custom domain should be entered as panel.example.com not https://panel.example.com or http://panel.example.com"); echo ""; return; } $query = misc\mysql\query("SELECT `name`, `owner` FROM `apps` WHERE `customDomain` = ? AND `secret` != ?", [$customDomain, $_SESSION['app']]); if ($query->num_rows > 0) { $row = mysqli_fetch_array($query->result); $name = $row["name"]; $owner = $row["owner"]; dashboard\primary\error("The domain {$customDomain} is already being used on app named \"{$name}\" owned by {$owner}. Use a different domain or subdomain please."); echo ""; return; } } else if (!empty($customDomain)) { dashboard\primary\error("You must have seller plan to utilize customer panel"); echo ""; return; } if($_SESSION['role'] == "tester" && !is_null($webhook)) { dashboard\primary\error("You must upgrade to developer or seller to use Discord webhook!"); echo ""; return; } if((!is_null($webhook) && !str_contains($webhook, "discord")) || (!is_null($webhook) && str_contains($webhook, "localhost")) || (!is_null($webhook) && str_contains($webhook, "127.0.0.1"))) { dashboard\primary\error("Webhook URL is supposed to be a Discord webhook!"); echo ""; return; } if($_SESSION['role'] == "tester" && $vpn) { dashboard\primary\error("You must upgrade to developer or seller to use VPN block!"); echo ""; return; } if (!empty($shoppywebhooksecret) && !empty($sellixwebhooksecret)) { dashboard\primary\error("You cannot utilize Sellix and Shoppy simultaneously due to conflicting JavaScript code"); echo ""; return; } if ($sessionduration > 604800) { dashboard\primary\error("Session duration can be at most 7 days/1 week"); echo ""; return; } $query = misc\mysql\query( "UPDATE `apps` SET `cooldown` = ?, `customDomain` = NULLIF(?, ''), `session` = ?, `tokensystem` = ?, `cooldownUnit` = ?, `sessionUnit` = ?, `appdisabled` = ?, `tokeninvalid` = ?, `hashcheckfail` = ?, `sessionunauthed` = ?, `userbanned` = ?, `vpnblocked` = ?, `keybanned` = ?, `usernametaken` = ?, `keynotfound` = ?, `keyused` = ?, `nosublevel` = ?, `usernamenotfound` = ?, `passmismatch` = ?, `hwidmismatch` = ?, `noactivesubs` = ?, `hwidblacked` = ?, `pausedsub` = ?, `enabled` = ?, `minUsernameLength` = ?, `blockLeakedPasswords` = ?, `hashcheck` = ?, `hwidcheck` = ?, `forceHwid` = ?, `minHwid` = ?, `vpnblock` = ?, `ver` = ?, `download` = NULLIF(?, ''), `webdownload` = NULLIF(?, ''), `webhook` = NULLIF(?, ''), `ipLogging` = ?, `resellerstore` = NULLIF(?, ''), `sellixsecret` = NULLIF(?, ''), `sellixdayproduct` = NULLIF(?, ''), `sellixweekproduct` = NULLIF(?, ''), `sellixmonthproduct` = NULLIF(?, ''), `sellixlifetimeproduct` = NULLIF(?, ''), `sellappsecret` = NULLIF(?, ''), `sellappdayproduct` = NULLIF(?, ''), `sellappweekproduct` = NULLIF(?, ''), `sellappmonthproduct` = NULLIF(?, ''), `sellapplifetimeproduct` = NULLIF(?, ''), `shoppysecret` = NULLIF(?, ''), `shoppydayproduct` = NULLIF(?, ''), `shoppyweekproduct` = NULLIF(?, ''), `shoppymonthproduct` = NULLIF(?, ''), `shoppylifetimeproduct` = NULLIF(?, ''), `customerPanelIcon` = ?, `panelstatus` = ?, `loggedInMsg` = ?, `pausedApp` = ?, `unTooShort` = ?, `pwLeaked` = ?, `chatHitDelay` = ?, `enabledFunctions` = ? WHERE `secret` = ?", [ $cooldownduration, $customDomain, $sessionduration, $tokenvalidation, $cooldownexpiry, $sessionexpiry, $appdisabledpost, $tokeninvalid, $hashcheckfailpost, $sessionunauthedpost, $userbannedpost, $vpnblockedpost, $keybannedpost, $usernametakenpost, $keynotfoundpost, $keyusedpost, $nosublevelpost, $usernamenotfoundpost, $passmismatchpost, $hwidmismatchpost, $noactivesubspost, $hwidblackedpost, $pausedsubpost, $status, $minUsernameLength, $blockLeakedPasswords, $hashstatus, $hwid, $forceHwid, $minHwid, $vpn, $ver, $dl, $webdl, $webhook, $ipLogging, $resellerstorelink, $sellixwebhooksecret, $sellixday, $sellixweek, $sellixmonth, $sellixlife, $sellappwebhooksecret, $sellappday, $sellappweek, $sellappmonth, $sellapplife, $shoppywebhooksecret, $shoppyday, $shoppyweek, $shoppymonth, $shoppylife, $customerPanelIcon, $panelstatus, $loggedInMsg, $pausedApp, $unTooShort, $pwLeaked, $chatHitDelay, $enabledFunctions, $_SESSION['app'] ] ); if ($query->affected_rows > 0) { $appName = strtolower($_SESSION["name"]); $ownerid = strtolower($_SESSION['ownerid']); $url = "https://api.cloudflare.com/client/v4/zones/{$cfZoneIdCache}/purge_cache"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(array("files" => ["https://keyauth.win/api/KeyAuthApp-{$appName}-{$ownerid}"]))); $headers = array( "Authorization: Bearer {$cfApiKeyCache}", "Content-Type: application/json", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_exec($curl); misc\cache\purge('KeyAuthApp:' . $_SESSION["name"] . ':' . $_SESSION['ownerid']); dashboard\primary\success("Successfully set settings!"); } else { dashboard\primary\error("Failed to set settings!"); } } if (isset($_POST['deleteHash'])){ $hashToDelete = $_POST['deleteHash']; $query = misc\mysql\query("UPDATE `apps` SET `hash` = REPLACE(`hash`,? , '') WHERE `secret` = ?", [$hashToDelete, $_SESSION['app']]); if ($query->affected_rows > 0) { dashboard\primary\success("Successfully deleted hash!"); } else { dashboard\primary\error("Failed to delete hash!"); } } ?>

Application Settings

Control your application here. Learn More. Tip: You can press Ctrl + S to save settings!


result->hostname; } ?> "; return; } $domainInput = $_POST['domain']; $url = "https://api.cloudflare.com/client/v4/zones/{$cfZoneIdCache}/custom_hostnames"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(array("hostname" => $domainInput))); $headers = array( "Authorization: Bearer {$cfApiKeyCache}", "Content-Type: application/json", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); $resp = curl_exec($curl); $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); $json = json_decode($resp); if($statusCode > 399) { dashboard\primary\error($json->errors[0]->message); echo " "; return; } $ownership_verification = $json->result->ownership_verification; $custom_domain_id = $json->result->id; // must keep the $ownership_verification and $custom_domain_id variables // ABOVE the dns.google request, to obtain the correct values $url = "https://dns.google/resolve?type=txt&name=_domainconnect.$domainInput"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $resp = curl_exec($curl); $json = json_decode($resp); if($json->Answer && $json->Answer[0]->data == "api.cloudflare.com/client/v4/dns/domainconnect") { $domainConnect = true; } ?>

Custom domain

value; $data = "domain=$rootDomain&cnamehost=$domainInput&verifytxt=$verifyTxt"; // Sign the data using the private key and SHA-256 algorithm $signature = ''; openssl_sign($data, $signature, $privateKey, OPENSSL_ALGO_SHA256); $signature = urlencode(base64_encode($signature)); openssl_free_key($privateKey); ?>


DNS Type:

TXT

DNS Name:

name ?>

DNS Content:

value ?>



DNS Type:

CNAME

DNS Name:


DNS Target:

api-worker.keyauth.win