From fcde966605f705e31a9f85630b4945fc669b652d Mon Sep 17 00:00:00 2001 From: AndrewZuo01 Date: Wed, 29 Nov 2023 11:44:10 +0800 Subject: [PATCH] FIX BUG --- internal/rpc/chat/login.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rpc/chat/login.go b/internal/rpc/chat/login.go index 4b2e3c4d..98a1abf1 100644 --- a/internal/rpc/chat/login.go +++ b/internal/rpc/chat/login.go @@ -251,8 +251,8 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( if (req.User.AreaCode == "" && req.User.PhoneNumber != "") || (req.User.AreaCode != "" && req.User.PhoneNumber == "") { return nil, errs.ErrArgs.Wrap("area code or phone number error") } - if req.User.PhoneNumber == "" && req.User.Account == "" && req.User.Email == "" { - return nil, errs.ErrArgs.Wrap("phone number, account, and email is empty") + if (req.User.PhoneNumber == "" || req.User.Account == "") && req.User.Email == "" { + return nil, errs.ErrArgs.Wrap("phone number, account, and email is empty") } var usedInvitationCode bool if !isAdmin {