mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: DingTalk provider value case unsensitive (#724)
This commit is contained in:
@ -97,3 +97,14 @@ func TestGetMaskedUsers(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetUserByField(t *testing.T) {
|
||||||
|
InitConfig()
|
||||||
|
|
||||||
|
user := GetUserByField("built-in", "DingTalk", "test")
|
||||||
|
if user != nil {
|
||||||
|
t.Logf("%+v", user)
|
||||||
|
} else {
|
||||||
|
t.Log("no user found")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -29,7 +29,7 @@ func GetUserByField(organizationName string, field string, value string) *User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
user := User{Owner: organizationName}
|
user := User{Owner: organizationName}
|
||||||
existed, err := adapter.Engine.Where(fmt.Sprintf("%s=?", field), value).Get(&user)
|
existed, err := adapter.Engine.Where(fmt.Sprintf("%s=?", strings.ToLower(field)), value).Get(&user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user