Skip to content

Commit

Permalink
Adapted recommendation from Maintainer for PR #1888
Browse files Browse the repository at this point in the history
Signed-off-by: Maik Brauer <[email protected]>
  • Loading branch information
VF-mbrauer committed Jan 5, 2021
1 parent eb9ef3b commit 4d246bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions connector/microsoft/microsoft.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Config struct {
Groups []string `json:"groups"`
GroupNameFormat GroupNameFormat `json:"groupNameFormat"`
UseGroupsAsWhitelist bool `json:"useGroupsAsWhitelist"`
UpnToLowercase bool `json:"upnToLowercase"`
emailToLowercase bool `json:"emailToLowercase"`
}

// Open returns a strategy for logging in through Microsoft.
Expand All @@ -69,7 +69,7 @@ func (c *Config) Open(id string, logger log.Logger) (connector.Connector, error)
groupNameFormat: c.GroupNameFormat,
useGroupsAsWhitelist: c.UseGroupsAsWhitelist,
logger: logger,
upnToLowercase: c.UpnToLowercase,
emailToLowercase: c.EmailToLowercase,
}
// By default allow logins from both personal and business/school
// accounts.
Expand Down Expand Up @@ -112,7 +112,7 @@ type microsoftConnector struct {
groups []string
useGroupsAsWhitelist bool
logger log.Logger
upnToLowercase bool
emailToLowercase bool
}

func (c *microsoftConnector) isOrgTenant() bool {
Expand Down Expand Up @@ -175,7 +175,7 @@ func (c *microsoftConnector) HandleCallback(s connector.Scopes, r *http.Request)
return identity, fmt.Errorf("microsoft: get user: %v", err)
}

if c.upnToLowercase {
if c.emailToLowercase {
user.Email = strings.ToLower(user.Email)
}

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ require (
github.com/lib/pq v1.3.0
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201204154048-1a8688af4cf1
github.com/mattn/go-sqlite3 v1.11.0
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/pkg/errors v0.9.1
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/prometheus/client_golang v1.4.0
Expand All @@ -47,7 +46,6 @@ require (
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/ldap.v2 v2.5.1
gopkg.in/square/go-jose.v2 v2.4.1
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect
sigs.k8s.io/testing_frameworks v0.1.2
)

Expand Down

0 comments on commit 4d246bc

Please sign in to comment.