- set correct authIDType when calling auth2.Login

This commit is contained in:
gazebo
2019-03-04 17:50:16 +08:00
parent 3e79e8a99b
commit 083f9ccbcf
3 changed files with 11 additions and 4 deletions

View File

@@ -120,9 +120,9 @@ func CreateAuthInfo(user IUser, authBindInfo *model.AuthBind, userData interface
UserData: userData,
}
if user != nil {
globals.SugarLogger.Debugf("CreateAuthInfo id:%s, id2:%s, authBindInfo:%s, authInfo:%s", authInfo.GetID(), authInfo.GetID2(), authInfo.GetMobile(), utils.Format4Output(authBindInfo, true), utils.Format4Output(authInfo, true))
globals.SugarLogger.Debugf("CreateAuthInfo id:%s, id2:%s, authInfo:%s", authInfo.GetID(), authInfo.GetID2(), authInfo.GetMobile(), utils.Format4Output(authInfo, true))
} else {
globals.SugarLogger.Debugf("CreateAuthInfo authBindInfo:%s, authInfo:%s", utils.Format4Output(authBindInfo, true), utils.Format4Output(authInfo, true))
globals.SugarLogger.Debugf("CreateAuthInfo authInfo:%s", utils.Format4Output(authInfo, true))
}
SetUserInfo(token, authInfo, DefTokenDuration)
return authInfo
@@ -163,6 +163,8 @@ func SendVerifyCode(authToken, captchaID, captchaValue, authID string) (err erro
}
// 账号密码时authIDType可能是UserIDID,UserIDID2,UserIDMobile,UserIDEmailauthSecret是密码的sha1
// mobile或email登录时authIDType必须相应为UserIDMobile,UserIDEmail
// 其它登录时authIDType无用
// 邮箱时如果允许authIDType是UserIDEmailauthSecret是验证码的sha1
// 手机时如果允许authIDType是UserIDMobileauthSecret是验证码的sha1
// 公众号登录authIDTypeD是UserIDEmptyauthSecret是code这个函数是被微信的回调调用不是直接被客户端调用