Dingtalk now supports linking with corpMobile

This commit is contained in:
Yang Luo
2023-05-17 22:14:57 +08:00
parent 37d0157d41
commit 983a30a2e0
2 changed files with 21 additions and 8 deletions

View File

@ -417,8 +417,15 @@ func (c *ApiController) Login() {
} else if provider.Category == "OAuth" {
// Sign up via OAuth
if application.EnableLinkWithEmail {
// find user that has the same email
user = object.GetUserByField(application.Organization, "email", userInfo.Email)
if userInfo.Email != "" {
// Find existing user with Email
user = object.GetUserByField(application.Organization, "email", userInfo.Email)
}
if user == nil && userInfo.Phone != "" {
// Find existing user with phone number
user = object.GetUserByField(application.Organization, "phone", userInfo.Phone)
}
}
if user == nil || user.IsDeleted {