Bugs
Complete

Registration BFF sends empty lang field, backend rejects with 422

## Bug The registration handler at `POST /api/auth/register` always includes a `lang` field in the payload forwarded to the backend. When the client does not provide `lang`, the handler sends `lang: ""` (empty string). The backend rejects this with: ```json {"detail":[{"type":"enum","loc":["body","lang"],"msg":"Input should be 'en' or 'fr'","input":""}]} ``` HTTP 422 Unprocessable Entity. ## Steps to reproduce 1. `POST /api/auth/register` with `{"first_name":"Test","last_name":"User","username":"testuser","email":"[email protected]"}` (no `lang` field) 2. The BFF forwards `{...fields, lang: ""}` to the backend 3. Backend returns 422 ## Expected behavior The BFF should either: - Omit the `lang` field when not provided by the client - Default to `"en"` when `lang` is empty ## Affected file `src/app/api/auth/register/handler.ts` — `postRegistration()` always includes `lang: input.lang` in the JSON body, even when it is an empty string. ## Workaround Clients must always include `lang: "en"` or `lang: "fr"` in the registration payload.

0 Comments

Sign in to comment

No comments yet. Be the first to share your thoughts!