This commit is contained in:
richboo111
2022-08-11 16:08:25 +08:00
parent 3b0c5e6895
commit 6c423b65a4
2 changed files with 6 additions and 2 deletions

View File

@@ -160,6 +160,7 @@ func getFixedTokenName(token string) *AuthInfo {
func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
token, tokenType := createToken(user, authBindInfo)
globals.SugarLogger.Debug("tokentokenType============", token, tokenType)
expireDuration := DefTokenDuration
authInfo = &AuthInfo{
AuthBindInfo: authBindInfo,
@@ -272,9 +273,12 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
// if user != nil {
// authBindEx.UserID = user.GetID()
// }
if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil {
if user2 := userProvider.GetUser(authBindEx.AuthID2, "auth_id2"); err != nil {
user = user2
}
//if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil {
// user = user2
//}
globals.SugarLogger.Debug("user检测1=============", user)
} else if authBindEx.UserID != "" {
user = userProvider.GetUser(authBindEx.UserID, UserIDID)

View File

@@ -30,7 +30,7 @@ func (a *QRCodeAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthB
if authBindEx, err = a.UnionFindAuthBind(AuthTypeQRCode, api.DingDingQRCodeAPI.GetAppID(), []string{AuthTypeStaff, AuthTypeQRCode}, userQRInfo.OpenID, userQRInfo.UnionID, userQRInfo); err == nil {
authBindEx.UserHint = &auth2.UserBasic{
Name: userQRInfo.Nickname,
//UserID: userQRInfo.,
//UserID: userQR Info.,
}
}
}