feat(antilopay): inject apay-tag meta on cabinet boot

Pairs with the bedolaga-bot commit that exposes
GET /cabinet/public/site-verification (JSON: { apay_tag: string | null }).

New useSiteVerification hook fires once on App mount, fetches the
configured tag value, and upserts <meta name='apay-tag' content='...'>
into document.head. When the bot returns null we proactively remove
any previously-rendered tag so toggling the env var off cleans up the
page.

Failure modes are silent — verification is best-effort and must
never block the cabinet from rendering. No admin UI field is needed:
the value lives in the bot's .env (ANTILOPAY_APAY_VERIFICATION_TAG),
matching how all other Antilopay credentials are configured.
This commit is contained in:
Fringg
2026-05-16 02:15:17 +03:00
parent f301d44f24
commit 6fa4afd5c1
3 changed files with 76 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ import { ErrorBoundary } from './components/ErrorBoundary';
import { PermissionRoute } from '@/components/auth/PermissionRoute';
import { saveReturnUrl } from './utils/token';
import { useAnalyticsCounters } from './hooks/useAnalyticsCounters';
import { useSiteVerification } from './hooks/useSiteVerification';
// Auth pages - load immediately (small)
import Login from './pages/Login';
import TelegramCallback from './pages/TelegramCallback';
@@ -229,6 +230,9 @@ function LegacySubscriptionRedirect() {
function App() {
useAnalyticsCounters();
// Pulls site-verification tokens (Antilopay apay-tag etc.) from the bot
// backend and injects matching <meta> tags into document.head.
useSiteVerification();
return (
<>