Skip to content

Commit 761443b

Browse files
committed
fixup some comments
1 parent 19e535d commit 761443b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

coderd/idpsync/organization.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ type OrganizationParams struct {
3636
Organizations []uuid.UUID
3737
}
3838

39+
// SyncOrganizations if enabled will ensure the user is a member of the provided
40+
// organizations. It will add and remove their membership to match the expected set.
3941
func (s AGPLIDPSync) SyncOrganizations(ctx context.Context, tx database.Store, user database.User, params OrganizationParams) error {
4042
// Nothing happens if sync is not enabled
4143
if !params.SyncEnabled {

enterprise/coderd/enidpsync/organizations.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ func (e EnterpriseIDPSync) ParseOrganizationClaims(ctx context.Context, mergedCl
5858
}
5959

6060
return idpsync.OrganizationParams{
61-
SyncEnabled: true,
61+
// If the field is not set, then sync is not enabled.
62+
SyncEnabled: e.OrganizationField != "",
6263
IncludeDefault: e.OrganizationAssignDefault,
6364
Organizations: userOrganizations,
6465
}, nil

0 commit comments

Comments
 (0)