fix(auth,api): resolve SSR vs CSR API URL routing and sanitize ADMIN_TOKEN parsing

- Implement getApiBaseUrl() and getAdminApiBaseUrl() to dynamically distinguish between Server/SSR (process.env.API_BASE_URL) and Client/CSR (process.env.NEXT_PUBLIC_API_BASE_URL)
- Fix missing data on main landing page in containerized environment
- Sanitize and trim ADMIN_TOKEN parsing in Go backend to prevent whitespace/quote mismatch
- Real-time token validation in AdminLayout with auto-redirection on token mismatch
- All unit and E2E test gates passed clean with unanimous PASS reviews
This commit is contained in:
2026-08-25 11:42:40 +09:00
parent 0a589bd3a2
commit 5f87631530
6 changed files with 74 additions and 16 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ func Load() *Config {
}
if token := os.Getenv("ADMIN_TOKEN"); token != "" {
cfg.AdminToken = token
cfg.AdminToken = strings.Trim(token, " \"'\r\n\t")
}
if autoMigrateStr := os.Getenv("AUTO_MIGRATE"); autoMigrateStr != "" {