Skip to content

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

Merged
albanm merged 3 commits intomasterfrom
fix/saml-single-membership-department
Apr 7, 2026
Merged

fix: update membership on login instead of rejecting (singleMembership)#115
albanm merged 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
@albanm albanm merged commit a8f3d70 into master Apr 7, 2026
3 checks passed
@albanm albanm deleted the fix/saml-single-membership-department branch April 7, 2026 08:05
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.

2 participants