Skip to content

fix: update membership on login instead of rejecting (singleMembership)#115

Open
aymericcousaert wants to merge 3 commits intomasterfrom
fix/saml-single-membership-department
Open

fix: update membership on login instead of rejecting (singleMembership)#115
aymericcousaert wants to merge 3 commits intomasterfrom
fix/saml-single-membership-department

Conversation

@aymericcousaert
Copy link
Copy Markdown
Collaborator

@aymericcousaert aymericcousaert commented Apr 2, 2026

Summary

  • When singleMembership is enabled and a user already belongs to an org with a different department, addMember now updates the existing membership (department, role) instead of throwing "cet utilisateur est déjà membre de cette organisation"
  • This fixes SAML SSO login failures on deployments where the IdP assigns a department that differs from the user's current one
  • Fixes pre-push hook to source fnm so tests run with Node 24 (required for native .ts support)

Test plan

  • Added 3 integration tests for singleMembership: department change, role change, department removal
  • Full test suite passes (87/87)

…rship is enabled

When singleMembership is true and a user already belongs to the org
with a different department, update the existing membership instead
of throwing "cet utilisateur est déjà membre de cette organisation".
This fixes SAML SSO login failures when the IdP assigns a different
department than what the user currently has.
The pre-push hook runs `npm run quality` which includes tests.
Tests require Node 24 for native .ts support, but husky hooks
don't inherit the fnm shell environment.
@github-actions github-actions bot added fix and removed fix labels Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant