From 044d46c36d5c36608cfb8c9ad3d81d9f416532d0 Mon Sep 17 00:00:00 2001 From: Haohan Yang <37651510+haohanyang@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:17:20 +0200 Subject: [PATCH] chore: replace `unmatchedEmailAndPasswordError` with unmatchedUsernameAndPasswordError` (#3889) replace unmatchedEmailAndPasswordError with unmatchedUsernameAndPasswordError --- server/router/api/v1/auth_service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/router/api/v1/auth_service.go b/server/router/api/v1/auth_service.go index 87d7367b..a30c0768 100644 --- a/server/router/api/v1/auth_service.go +++ b/server/router/api/v1/auth_service.go @@ -25,7 +25,7 @@ import ( ) const ( - unmatchedEmailAndPasswordError = "unmatched email and password" + unmatchedUsernameAndPasswordError = "unmatched username and password" ) func (s *APIV1Service) GetAuthStatus(ctx context.Context, _ *v1pb.GetAuthStatusRequest) (*v1pb.User, error) { @@ -51,11 +51,11 @@ func (s *APIV1Service) SignIn(ctx context.Context, request *v1pb.SignInRequest) return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to find user by username %s", request.Username)) } if user == nil { - return nil, status.Errorf(codes.InvalidArgument, unmatchedEmailAndPasswordError) + return nil, status.Errorf(codes.InvalidArgument, unmatchedUsernameAndPasswordError) } // Compare the stored hashed password, with the hashed version of the password that was received. if err := bcrypt.CompareHashAndPassword([]byte(user.PasswordHash), []byte(request.Password)); err != nil { - return nil, status.Errorf(codes.InvalidArgument, unmatchedEmailAndPasswordError) + return nil, status.Errorf(codes.InvalidArgument, unmatchedUsernameAndPasswordError) } workspaceGeneralSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx)