Skip to content

Commit

Permalink
Address feedback by @stevehobbsdev
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Jul 18, 2023
1 parent e5cea6f commit e87a06b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Token/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,10 @@ public function organization(
}

if (null !== $organizationName) {
// Normalize the org_name claim to lowercase for case insensitive comparisons.
$lowercaseOrganizationName = strtolower($organizationName);
$allowedOrganizationNames = array_map('strtolower', array_filter($allowedOrganizations, static fn ($org): bool => ! str_starts_with($org, 'org_')));

// org_name claim is present and in the allowlist. Success.
if (in_array($lowercaseOrganizationName, $allowedOrganizationNames, true)) {
if (in_array($organizationName, $allowedOrganizationNames, true)) {
return $this;
}
}
Expand Down

0 comments on commit e87a06b

Please sign in to comment.