Skip to content

fix: parse FRONTEND_URL env as a single string#77

Merged
Bccorb merged 1 commit into
mainfrom
fix/frontend-url-env-parsing
Jul 10, 2026
Merged

fix: parse FRONTEND_URL env as a single string#77
Bccorb merged 1 commit into
mainfrom
fix/frontend-url-env-parsing

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The frontend_url system config (added for building magic-link redirects) was wired into the env map, schema, and consumer but never into the env parser. bootstrapSystemConfig calls parseSystemConfigEnvValue for every key in SYSTEM_CONFIG_ENV_MAP, so as soon as FRONTEND_URL was set the parser hit its default branch and threw Unhandled system config key: frontend_url, crashing the server on startup.

Changes

  • parseSystemConfigEnvValue handles frontend_url as a raw string, matching the z.url().optional() schema and the ${frontendUrl}/verify-magiclink consumer in magicLinks.ts.
  • Add a unit test asserting frontend_url parses to a single string, not an array.
  • Document FRONTEND_URL in .env.example.
  • Changeset included.

Testing

  • npm run lint, npm run typecheck, npm run build: pass.
  • Full test suite: 497 passed.
  • Verified end to end via docker compose: the auth service boots clean with FRONTEND_URL set, and POST /auth/registration/register returns 200 {"message":"Success"} through the portal API (previously 500 fetch failed because the server never started).

frontend_url was added to the system config env map and schema but the env
parser had no case for it, so bootstrapSystemConfig threw Unhandled system
config key: frontend_url whenever FRONTEND_URL was set. Handle it as a raw
string (matching the z.url() schema), add a unit test, and document the
variable in .env.example.
@Bccorb Bccorb merged commit 6747d2f into main Jul 10, 2026
2 of 3 checks passed
@Bccorb Bccorb deleted the fix/frontend-url-env-parsing branch July 10, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant