fix: evaluate login mode env at runtime#4283
Conversation
|
@mturac is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR fixes a Next.js static-rendering issue where
Confidence Score: 4/5The three The src/app/api/config/route.ts — the Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant NextJS as Next.js Server
participant Env as Runtime Env Vars
Note over NextJS: Before fix — static rendering at build time
Browser->>NextJS: GET /login
NextJS-->>Browser: Page built at build time (DISABLE_LOGIN/CLOUD_MODE may be missing)
Note over NextJS: After fix — force-dynamic
Browser->>NextJS: GET /login
NextJS->>Env: Read DISABLE_LOGIN / CLOUD_MODE
alt env var set
Env-->>NextJS: value present
NextJS-->>Browser: return null (blank page)
else env var absent
Env-->>NextJS: undefined
NextJS-->>Browser: Render LoginPage
end
Browser->>NextJS: GET /api/config
NextJS->>Env: Read CLOUD_MODE, PRIVATE_MODE, etc.
Env-->>NextJS: current runtime values
NextJS-->>Browser: JSON config with live env state
|
Summary
Fixes #3549
Testing