auth2.Login中,暂时禁用利用得到受信任的信息查找用户

This commit is contained in:
gazebo
2019-11-21 10:40:21 +08:00
parent 7c5e411f8b
commit 603c6bffa2

View File

@@ -254,15 +254,16 @@ func Login(ctx *Context, authType, authID, authIDType, authSecret string) (authI
} else {
// 返回authBind中UserID为空表示只是认证但本地没有记录这种情况会返回临时TOKEN
if authBindEx.UserHint != nil && authBindEx.UserID == "" {
if authBindEx.UserHint.Mobile != "" {
user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile)
}
if user == nil && authBindEx.UserHint.Email != "" {
user = userProvider.GetUser(authBindEx.UserHint.Email, UserIDEmail)
}
if user != nil {
authBindEx.UserID = user.GetID()
}
// 利用得到受信任的信息查找用户
// if authBindEx.UserHint.Mobile != "" {
// user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile)
// }
// if user == nil && authBindEx.UserHint.Email != "" {
// user = userProvider.GetUser(authBindEx.UserHint.Email, UserIDEmail)
// }
// if user != nil {
// authBindEx.UserID = user.GetID()
// }
} else if authBindEx.UserID != "" {
user = userProvider.GetUser(authBindEx.UserID, UserIDID)
}