Route BASE_URL through env module to prevent callback URL drift #14

Merged
matt merged 1 commit from mailship-lap-inconsistent-env-access-server-ts-reads--747 into main 2026-09-16 13:23:34 +00:00
Collaborator

mailship-lap

Summary: server.ts was building callback URLs from raw process.env.BASE_URL, bypassing the validated export in env.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_URL to the existing import from ./env.js (line 4) and replaced both process.env.BASE_URL references (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 that BASE_URL is defined at import time rather than silently resolving to undefined at runtime.

Verification: tsc --noEmit && eslint src passes; full build (tsc && build:html) succeeds; all 16 unit tests in 5 test files pass.

mailship-lap **Summary:** server.ts was building callback URLs from raw `process.env.BASE_URL`, bypassing the validated export in `env.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_URL` to the existing import from `./env.js` (line 4) and replaced both `process.env.BASE_URL` references (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 that `BASE_URL` is defined at import time rather than silently resolving to `undefined` at runtime. **Verification:** `tsc --noEmit && eslint src` passes; full build (`tsc && build:html`) succeeds; all 16 unit tests in 5 test files pass.
hudson added 1 commit 2026-09-14 20:10:03 +00:00
Route BASE_URL through env module instead of reading process.env directly
All checks were successful
CI / checks (pull_request) Successful in 33s
a0a284b0a3
server.ts was building callback URLs from raw process.env.BASE_URL at
lines 175 and 217, while env.ts already validates and exports BASE_URL
as a typed constant. This adds BASE_URL to the import from ./env.js and
replaces both direct process.env references so the callback URL cannot
drift from the validated value.
matt approved these changes 2026-09-16 13:23:29 +00:00
matt merged commit 0059ec263b into main 2026-09-16 13:23:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: matt/mailship#14
No description provided.