Route BASE_URL through env module to prevent callback URL drift #14
Loading…
Reference in a new issue
No description provided.
Delete branch "mailship-lap-inconsistent-env-access-server-ts-reads--747"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mailship-lap
Summary: server.ts was building callback URLs from raw
process.env.BASE_URL, bypassing the validated export inenv.ts. This routes BASE_URL through the env module like all other config values, so the callback URL cannot drift from the validated value.Changes: Added
BASE_URLto the existing import from./env.js(line 4) and replaced bothprocess.env.BASE_URLreferences (lines 175 and 217) with the imported constant. No behavioural change — both values resolve to the same environment variable, but the env module now validates thatBASE_URLis defined at import time rather than silently resolving toundefinedat runtime.Verification:
tsc --noEmit && eslint srcpasses; full build (tsc && build:html) succeeds; all 16 unit tests in 5 test files pass.