fix(login): omit client_id from password_login body when empty #13
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
psa-systems/bunyip!13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/login-skip-empty-client-id"
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?
bunyip-web's password_login unconditionally put
cfg.client_idinto the JSON body it POSTed to mokosh-server's /v1/auth/login. mokosh-server types LoginRequest.client_id asOption<uuid::Uuid>; serde's behaviour for that shape accepts a missing field or null as None, accepts a valid UUID string as Some, and 422s on anything else (including the empty string).bunyip-web's OidcConfig::from_env() falls back to
""whenever the image was built without BUNYIP_OIDC_CLIENT_ID set - the common shape for staging deploys where the SaaS shell only needs an OP-session cookie (no per-RP token bundle). On those deploys every /login submit returned 422 Unprocessable Content; the SPA mapped that to the generic "Email or password didn't match" toast even when the credentials were correct, and the audit log contained zero matching attempts because the request never made it past the deserialiser.Switch to a json!() builder that includes
client_idonly when the configured value is non-empty. mokosh-server then deserialises the body asclient_id: Noneand falls back to the legacy session-cookie-only flow, which is what staging actually wants.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com