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

Set both mail addresses to lowercase before comparing #5

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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