From c0c79c368d425d53b893bb2fbeb86c1ac25a810f Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 2 Sep 2019 14:27:34 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E7=94=A8=E6=88=B7=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=AD=A3=E7=A1=AE=E6=9B=B4=E6=96=B0=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AE=A4=E8=AF=81=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/auth2/auth2.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index 25ee10c06..617bcc6cd 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -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) + } } } }