Disable activation on scim profiles
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user