Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Set both mail addresses to lowercase before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrizic committed May 10, 2024
1 parent 002f1c5 commit 16bb690
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/microsoftgraph/msgraph-sdk-go/groups"
"github.com/microsoftgraph/msgraph-sdk-go/models"
"log/slog"
"strings"
)

type Config struct {
Expand Down Expand Up @@ -108,9 +109,10 @@ func (az *Azure) IsUserInGroup(ctx context.Context, email string) (isInGroup boo
if err != nil {
return false, nil, err
}
emailLC := strings.ToLower(email)

for _, user := range users {
if user.Email == email {
if strings.ToLower(user.Email) == emailLC {
return true, &user.DisplayName, nil
}
}
Expand Down

0 comments on commit 16bb690

Please sign in to comment.