fix(portal-bff): use the real portal-admin dev port (4300) in admin-flow references #131

Merged
julien merged 2 commits from fix/portal-admin-dev-port-references into main 2026-05-14 15:40:08 +02:00

2 Commits

Author SHA1 Message Date
Julien Gautier 986c3acea1 fix(portal-bff): add portal-admin :4300 to CORS_ALLOWED_ORIGINS in .env.example
CI / commits (pull_request) Successful in 2m51s
CI / scan (pull_request) Successful in 3m0s
CI / check (pull_request) Successful in 3m9s
CI / a11y (pull_request) Successful in 3m2s
CI / perf (pull_request) Successful in 6m19s
Caught while reviewing the previous port-correction commit on this
branch. The CORS section still pointed to "Add :4201 once portal-admin
grows its own dev server" — but portal-admin has its dev server (on
:4300, not :4201), and the SPA will hit the BFF with credentials as
soon as the admin auth flow lands. Without the origin in the allowlist
the browser blocks the call and the developer chases a CORS error
instead of getting to work.

Updates the example to list both dev origins and points at
`apps/<app>/project.json` `serve.options.port` as the source of truth
so future readers don't have to grep for it.

Local `.env` is on the developer to update — this only touches
`.env.example`. Behaviour change is opt-in.
2026-05-14 15:37:04 +02:00
Julien Gautier 2604ed3efd fix(portal-bff): use the real portal-admin dev port (4300) in admin-flow references
PR #129 baked `4201` into a few comments and test fixtures as the
admin SPA's dev port. The actual port wired in
`apps/portal-admin/project.json` `serve.options.port` is `4300` — the
Nx serve target listens on 4300 in dev. Aligning the references so a
contributor reading `.env.example` or the test fixtures sees the same
number their browser is hitting.

Touched:
- `apps/portal-bff/.env.example` — `ENTRA_ADMIN_POST_LOGOUT_REDIRECT_URI`
  default + the surrounding comment.
- `apps/portal-bff/src/config/check-cors-allowlist.ts` — stale
  doc-comment that pre-dated the portal-admin scaffolding.
- `auth.module.spec.ts`, `auth.controller.spec.ts`,
  `auth.service.spec.ts`, `admin-auth.controller.spec.ts`,
  `check-entra-config.spec.ts` — fixture `adminPostLogoutRedirectUri`
  values. Tests don't depend on the port; aligned for clarity only.

No behaviour change. 278 specs still pass.
2026-05-14 15:28:32 +02:00