One-Click OAuth (Server Mode)
Recommended. Client key/secret are stored in Cloudflare environment variables, so users only need to click login.
Required env on Cloudflare Pages: TIKTOK_CLIENT_KEY,
TIKTOK_CLIENT_SECRET, TIKTOK_REDIRECT_URI.
Build Authorization URL
Required params: client_key, redirect_uri, scope,
state. Response type is fixed as code.
Use Web mode with your live domain callback URL.
Use a random string to prevent CSRF.
Keep your client_secret on server side only. Never expose secret in this page.