mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
Avoid linking the same account twice.
This commit is contained in:
@ -24,6 +24,10 @@ import (
|
||||
)
|
||||
|
||||
func GetUserByField(organizationName string, field string, value string) *User {
|
||||
if field == "" || value == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
user := User{Owner: organizationName}
|
||||
existed, err := adapter.Engine.Where(fmt.Sprintf("%s=?", field), value).Get(&user)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user