Disable activation on scim profiles

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-18 17:14:43 +04:00
parent 13aef29ddf
commit 9941a6a66a
12 changed files with 163 additions and 287 deletions

View File

@@ -177,6 +177,10 @@ func (s *AuthService) ActivateAccount(
return fmt.Errorf("cannot load user: %w", err)
}
if profile.Source == coredata.ProfileSourceSCIM {
return NewUserManagedBySCIMError(profile.ID)
}
if profile.State == coredata.ProfileStateInactive {
profile.State = coredata.ProfileStateActive
profile.UpdatedAt = now

View File

@@ -372,6 +372,10 @@ func (s *OrganizationService) InviteUser(
return fmt.Errorf("cannot load profile: %w", err)
}
if profile.Source == coredata.ProfileSourceSCIM {
return NewUserManagedBySCIMError(profile.ID)
}
err = invitation.Insert(ctx, tx, scope)
if err != nil {
return fmt.Errorf("cannot insert invitation: %w", err)

View File

@@ -69,6 +69,7 @@ func NewProfile(profile *coredata.MembershipProfile) *Profile {
return &Profile{
ID: profile.ID,
FullName: profile.FullName,
EmailAddress: profile.EmailAddress,
Source: profile.Source.String(),
State: profile.State,
AdditionalEmailAddresses: profile.AdditionalEmailAddresses,