fix(portal-bff): use the real portal-admin dev port (4300) in admin-flow references #131
Reference in New Issue
Block a user
Delete Branch "fix/portal-admin-dev-port-references"
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?
Summary
PR #129 (
feat(portal-bff): distinct admin session + /api/admin/auth flow) baked4201into a handful of comments, test fixtures, and the.env.exampleas the portal-admin dev port. The actual port wired in apps/portal-admin/project.jsonserve.options.portis 4300 — that's whatpnpm nx serve portal-adminlistens on.This PR aligns the references so a contributor copying values from
.env.example(or reading the test fixtures) sees the same port their browser is going to hit.It also drops
http://localhost:4300intoCORS_ALLOWED_ORIGINS— the portal-admin SPA will hit the BFF with credentials as soon as the admin auth flow is exercised end-to-end, and without the origin in the allowlist the browser blocks the call. Better to set the right example now than have the next contributor chase a CORS error.Touched
ENTRA_ADMIN_POST_LOGOUT_REDIRECT_URIdefault + the surrounding comment now point athttp://localhost:4300/.CORS_ALLOWED_ORIGINSexample lists both:4200(portal-shell) and:4300(portal-admin).apps/<app>/project.jsonserve.options.portas the source of truth so a future reader doesn't have to grep.adminPostLogoutRedirectUrivalues inauth.module.spec.ts,auth.controller.spec.ts,auth.service.spec.ts,admin-auth.controller.spec.ts,check-entra-config.spec.ts— tests don't depend on the port; aligned for clarity only.Test plan
grep -rn 4201 apps/ libs/→ empty.pnpm nx test portal-bff— 278 specs pass (unchanged from #129; this PR only touches strings)..envto pick up the new port + origin.Notes for the reviewer
The two new env vars from #129 (
ENTRA_ADMIN_REDIRECT_URI,ENTRA_ADMIN_POST_LOGOUT_REDIRECT_URI) plus the existingCORS_ALLOWED_ORIGINSare mandatory at boot. If your localapps/portal-bff/.envstill has the4201value, the BFF will still start (any valid URL passes the validators) — but admin logout will 302 you to a port nothing is listening on, and the admin SPA's BFF calls will fail CORS. Update to4300to match the actual portal-admin dev server.