Skip to content

Commit

Permalink
External users can no longer change their names, similar to emails
Browse files Browse the repository at this point in the history
  • Loading branch information
alihadimazeh committed Jun 10, 2024
1 parent c4fcac0 commit 1e62f15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function UpdateUserForm({ user }) {

return (
<Form methods={methods} onSubmit={updateUserAPI.mutate}>
<FormControl field={fields.name} type="text" />
<FormControl field={fields.name} type="text" readOnly />
<FormControl field={fields.email} type="email" readOnly />
<FormSelect field={fields.language} variant="dropdown">
{
Expand Down

0 comments on commit 1e62f15

Please sign in to comment.