- 用户已经存在,自动继承时,正确更新当前认证方式

This commit is contained in:
gazebo
2019-09-02 14:27:34 +08:00
parent f0d8582b12
commit c0c79c368d

View File

@@ -269,9 +269,11 @@ func Login(authType, authID, authIDType, authSecret string) (authInfo *AuthInfo,
}
authInfo = createAuthInfo(user, authBindEx)
if needAutoAddAuthBind {
if authers[authInfo.AuthBindInfo.Type].AddAuthBind(authInfo.AuthBindInfo, user.GetName()) == nil {
// todo用户类型应该要与RegisterUser一起统一处理
userProvider.UpdateUserType(user.GetID(), handler.GetUserType(), UpdateUserTypeAdd)
if authers[authInfo.AuthBindInfo.Type].UnbindAuth(user.GetID(), authInfo.GetAuthType(), user.GetName()) == nil {
if authers[authInfo.AuthBindInfo.Type].AddAuthBind(authInfo.AuthBindInfo, user.GetName()) == nil {
// todo用户类型应该要与RegisterUser一起统一处理
userProvider.UpdateUserType(user.GetID(), handler.GetUserType(), UpdateUserTypeAdd)
}
}
}
}