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
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"encoding/hex"
"flag"
"log"
"strings"
"time"
"git.godopu.com/lab/landing_page/backend/internal/config"
@@ -37,7 +38,7 @@ func main() {
cfg.GinMode = *ginModeFlag
}
if *adminTokenFlag != "" {
cfg.AdminToken = *adminTokenFlag
cfg.AdminToken = strings.Trim(*adminTokenFlag, " \"'\r\n\t")
}
if cfg.AdminToken == "" {