This commit is contained in:
richboo111
2022-08-12 11:15:45 +08:00
parent 2cc50637a8
commit d378b5e469

View File

@@ -178,7 +178,7 @@ func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
authInfo.ExpiresAt = time.Now().Add(expireDuration).Unix() authInfo.ExpiresAt = time.Now().Add(expireDuration).Unix()
globals.SugarLogger.Debugf("createAuthInfo authInfo:%s", utils.Format4Output(authInfo, true)) globals.SugarLogger.Debugf("createAuthInfo authInfo:%s", utils.Format4Output(authInfo, true))
} }
SetUserInfo(token, authInfo, expireDuration) //SetUserInfo(token, authInfo, expireDuration)
return authInfo return authInfo
} }
@@ -264,7 +264,7 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
} else { } else {
// 返回authBind中UserID为空表示只是认证但本地没有记录这种情况会返回临时TOKEN // 返回authBind中UserID为空表示只是认证但本地没有记录这种情况会返回临时TOKEN
if authBindEx.UserHint != nil && authBindEx.UserID == "" { if authBindEx.UserHint != nil && authBindEx.UserID == "" {
globals.SugarLogger.Debug("进入,输出一下authBindEx,authBindEx.UserHint", authBindEx, authBindEx.UserHint) globals.SugarLogger.Debug("进入")
// 利用得到受信任的信息查找用户 // 利用得到受信任的信息查找用户
// if authBindEx.UserHint.Mobile != "" { // if authBindEx.UserHint.Mobile != "" {
// user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile) // user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile)
@@ -279,6 +279,9 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
if user2 := userProvider.GetUser(authBindEx.AuthID2, "auth_id2"); user2 != nil { if user2 := userProvider.GetUser(authBindEx.AuthID2, "auth_id2"); user2 != nil {
user = user2 user = user2
} }
//if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil {
// user = user2
//}
globals.SugarLogger.Debug("user检测1=============", user) globals.SugarLogger.Debug("user检测1=============", user)
} else if authBindEx.UserID != "" { } else if authBindEx.UserID != "" {
user = userProvider.GetUser(authBindEx.UserID, UserIDID) user = userProvider.GetUser(authBindEx.UserID, UserIDID)