Phase 7: Frontend auth — React Router, AuthContext, Login/Register, API client

This commit is contained in:
Suslov-MD
2026-08-16 08:54:31 +00:00
parent 281daa4717
commit ac85d71c65
16 changed files with 578 additions and 3 deletions
+2
View File
@@ -36,6 +36,7 @@ export interface Env {
readonly jwtSecret: string;
readonly jwtExpiresIn: string;
readonly clientOrigin: string;
readonly clientOrigins: string[];
readonly uploadDir: string;
readonly maxUploadSize: number;
readonly schedulerIntervalMs: number;
@@ -105,6 +106,7 @@ export function loadEnv(): Env {
jwtSecret: required('JWT_SECRET'),
jwtExpiresIn: process.env.JWT_EXPIRES_IN ?? '7d',
clientOrigin: process.env.CLIENT_ORIGIN ?? 'http://localhost:5173',
clientOrigins: (process.env.CLIENT_ORIGIN ?? 'http://localhost:5173').split(',').map((s) => s.trim()),
uploadDir,
maxUploadSize: parseMaxUploadSize(process.env.MAX_UPLOAD_SIZE ?? String(20 * 1024 * 1024)),
schedulerIntervalMs: Number.parseInt(process.env.SCHEDULER_INTERVAL_MS ?? '20000', 10),