From 1e62f15202602bbd92349a83c6ca022cc6e07dec Mon Sep 17 00:00:00 2001 From: Ali Hadi Mazeh Date: Mon, 10 Jun 2024 14:09:14 -0400 Subject: [PATCH] External users can no longer change their names, similar to emails --- app/controllers/api/v1/users_controller.rb | 3 ++- app/javascript/components/users/user/forms/UpdateUserForm.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index e891d596c9..8a19fe57e5 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -166,7 +166,8 @@ def create_user_params end def update_user_params - @update_user_params ||= params.require(:user).permit(:name, :password, :avatar, :language, :role_id, :invite_token) + external_auth? ? @update_user_params ||= params.require(:user).permit(:password, :avatar, :language, :role_id, :invite_token) + : params.require(:user).permit(:name, :password, :avatar, :language, :role_id, :invite_token) end def change_password_params diff --git a/app/javascript/components/users/user/forms/UpdateUserForm.jsx b/app/javascript/components/users/user/forms/UpdateUserForm.jsx index 7d524695b8..251df7fff5 100644 --- a/app/javascript/components/users/user/forms/UpdateUserForm.jsx +++ b/app/javascript/components/users/user/forms/UpdateUserForm.jsx @@ -70,7 +70,7 @@ export default function UpdateUserForm({ user }) { return (
- + {