Files
romm/backend/handler/auth
Georges-Antoine Assi 2d6a937d4a fix(auth): link an OIDC sign-in by email only when an admin or the provider set it
A first OIDC sign-in linked any account holding the same email and applied
the provider's role claim to it. Users choose their own email (profile edit,
invite registration), so one could take an address belonging to someone at
the provider and receive that identity and its role on their first sign-in.

Users gain an email_trusted flag: set when an admin creates the account or
saves its email, or when the provider writes it, and cleared when the user
or a delegated non-admin manager sets it. Email matching refuses an account
whose email is untrusted with a 403. Existing accounts are migrated as
trusted so pending first sign-ins keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:37:54 -05:00
..