This commit is contained in:
gazebo
2019-03-05 11:43:40 +08:00
parent 12827d08a3
commit f925049983
3 changed files with 7 additions and 3 deletions

View File

@@ -177,7 +177,7 @@ func Login(authType, authID, authIDType, authSecret string) (authInfo *AuthInfo,
if handler := authers[authType]; handler != nil {
var authBind *model.AuthBind
var user IUser
realauthID := authID
realAuthID := authID
if authIDType == AuthTypePassword {
if authID == "" {
return nil, ErrInvalidParams
@@ -185,9 +185,9 @@ func Login(authType, authID, authIDType, authSecret string) (authInfo *AuthInfo,
if user = userProvider.GetUser(authID, authIDType); user == nil {
return nil, ErrUserNotExist
}
realauthID = user.GetID()
realAuthID = user.GetID()
}
if authBind, err = handler.VerifySecret(realauthID, authSecret); err == nil {
if authBind, err = handler.VerifySecret(realAuthID, authSecret); err == nil {
if authBind == nil { // mobile, email会返回nil表示不会新建AuthBind实体
user = userProvider.GetUser(authID, authIDType)
authBind = &model.AuthBind{