diff --git a/docs/pow-server/invite-validate.php b/docs/pow-server/invite-validate.php index 83f2e3c..5d34289 100644 --- a/docs/pow-server/invite-validate.php +++ b/docs/pow-server/invite-validate.php @@ -13,6 +13,12 @@ if (!REQUIRE_INVITE_CODE) { } $input = json_decode(file_get_contents('php://input'), true); + +if (!empty($input['check'])) { + echo json_encode(['valid' => false, 'required' => true]); + exit; +} + $code = trim($input['code'] ?? ''); if (!$code) { diff --git a/js/components/auth-modal.js b/js/components/auth-modal.js index 197b08f..d17725d 100644 --- a/js/components/auth-modal.js +++ b/js/components/auth-modal.js @@ -30,7 +30,7 @@ class AuthModal extends HTMLElement { const res = await fetch(`${POW_SERVER}/invite/validate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ code: '' }) + body: JSON.stringify({ check: true }) }) const data = await res.json() this.requireInviteCode = !data.valid