- set correct authIDType when calling auth2.Login
This commit is contained in:
@@ -44,7 +44,7 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A
|
||||
if user == nil || user.UserID2 == "" || user.Name == "" || user.Mobile == "" {
|
||||
return nil, model.ErrCodeGeneralFailed, ErrUserIDAndNameMustGiven
|
||||
}
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, user.Mobile, auth2.UserIDNone, mobileVerifyCode)
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, user.Mobile, auth2.UserIDMobile, mobileVerifyCode)
|
||||
if err = err2; err == nil {
|
||||
if mobileAuth.IUser != nil {
|
||||
return nil, model.ErrCodeUserAlreadyExist, auth2.ErrUserMobileAlreadyExist
|
||||
@@ -78,7 +78,7 @@ func GetUserBindAuthInfo(ctx *jxcontext.Context) (authList []*model.AuthBind, er
|
||||
func ChangeMobile2(ctx *jxcontext.Context, mobile, mobileVerifyCode string) (err error) {
|
||||
authInfo, err := ctx.GetV2AuthInfo()
|
||||
if err == nil {
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, mobile, auth2.UserIDNone, mobileVerifyCode)
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, mobile, auth2.UserIDMobile, mobileVerifyCode)
|
||||
if err = err2; err == nil {
|
||||
if mobileAuth.IUser != nil && authInfo.GetID() != mobileAuth.GetID() {
|
||||
return errors.New("手机号已经存在")
|
||||
|
||||
Reference in New Issue
Block a user