Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: allow set empty phone (#6594)

boojack0987121e4062
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 8ad98448d7..1f06ebfcf4 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -324,11 +324,10 @@ func (s *AuthService) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRe
patch.MFAConfig = &storepb.MFAConfig{}
}
case "phone":
- if request.User.Phone == "" {
- return nil, status.Errorf(codes.InvalidArgument, "phone number cannot be empty")
- }
- if err := validatePhone(request.User.Phone); err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid phone number %q, error: %v", request.User.Phone, err)
+ if request.User.Phone != "" {
+ if err := validatePhone(request.User.Phone); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid phone number %q, error: %v", request.User.Phone, err)
+ }
}
patch.Phone = &request.User.Phone
}
diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vue
index 8e293ab059..ab11b335d3 100644
--- a/frontend/src/views/ProfileDashboard.vue
+++ b/frontend/src/views/ProfileDashboard.vue
@@ -397,7 +397,7 @@ const saveEdit = async () => {
if (userPatch.email !== user.value.email) {
updateMask.push("email");
}
- if (userPatch.phone && userPatch.phone !== user.value.phone) {
+ if (userPatch.phone !== user.value.phone) {
updateMask.push("phone");
}
if (userPatch.password !== user.value.email) {