refactor(client): tighten env type
All checks were successful
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-01-29 11:53:14 +08:00
parent 65f86a8156
commit b8c89fcf5f
2 changed files with 15 additions and 1 deletions

View File

@@ -8,10 +8,13 @@ import { getToken } from '@/lib/token';
import { useExchangeToken } from '@/hooks/data/useExchangeToken';
import { useEffect } from 'react';
const baseUrl = import.meta.env.VITE_APP_BASE_URL;
const authorizeSchema = z.object({
response_type: z.literal('code').default('code'),
client_id: z.literal('org_client').default('org_client'),
redirect_uri: z.string().default(`${new URL(import.meta.env.VITE_APP_BASE_URL as string).toString()}token`),
redirect_uri: z.string().default(`${new URL(baseUrl).toString()}token`),
state: z.string().default(generateOAuthState()),
});

11
client/cms/src/vite.env.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
interface ViteTypeOptions {
strictImportMetaEnv: unknown
}
interface ImportMetaEnv {
readonly VITE_APP_BASE_URL: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}