538cfb9c5b
Add a login/register toggle to ConnectPage backed by a new useRegisterMutation (register -> /auth/me, mirroring login). The toggle is shown only when REGISTRATION_ENABLED, resolved with the same precedence as the API base URL: runtime window.__APP_CONFIG__ > PUBLIC_ENABLE_REGISTRATION env > default true. The prod runtime-config script injects the runtime flag. The backend's ALLOW_REGISTRATION stays the real authority; this only gates the UI. EN/RU strings added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
486 B
TypeScript
18 lines
486 B
TypeScript
/// <reference types="@rsbuild/core/types" />
|
|
interface ImportMetaEnv {
|
|
readonly PUBLIC_API_BASE_URL?: string;
|
|
readonly PUBLIC_ENABLE_REGISTRATION?: string;
|
|
}
|
|
interface ImportMeta {
|
|
readonly env: ImportMetaEnv;
|
|
}
|
|
|
|
// Runtime operator config injected by /config.js before the app bundle loads
|
|
// (written from $PUBLIC_API_BASE_URL at container start). See src/config/env.ts.
|
|
interface Window {
|
|
__APP_CONFIG__?: {
|
|
apiBaseUrl?: string;
|
|
enableRegistration?: boolean;
|
|
};
|
|
}
|