From 16bb69054bb349b587a2d5f04b17c50ed48ccb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darko=20Kri=C5=BEi=C4=87?= Date: Fri, 10 May 2024 18:19:09 +0200 Subject: [PATCH] Set both mail addresses to lowercase before comparing --- azure/azure.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure/azure.go b/azure/azure.go index 364efd5..0f6fe8a 100644 --- a/azure/azure.go +++ b/azure/azure.go @@ -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 { @@ -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 } }