Skip to content

auth.userUpdate() overwrite the original object #1762

Open
@Karman40

Description

@Karman40

[REQUIRED] Step 2: Describe your environment

  • Operating System version: WIN11
  • Firebase SDK version: 10.3.0 (admin)
  • Firebase Product: auth
  • Node.js version: v16
  • NPM version: _____

[REQUIRED] Step 3: Describe the problem

Relevant Code:

console.log(body);
await auth.updateUser(param.id, body);
console.log(body);

Body before auth.updateUser

UserUpdateDto {
  email: '[email protected]',
  displayName: 'Basecloud',
  phoneNumber: null,
  role: 'user',
  emailVerified: true,
  disabled: false,
  mfaRequired: false,
  needChangePassword: false
}

Body after auth.updateUser

UserUpdateDto {
  email: '[email protected]',
  displayName: 'Basecloud',
  emailVerified: true,
  localId: '62a66160b651fe47a7cdde20',
  deleteProvider: [ 'phone' ],
  disableUser: false
}

Soft bug fix

console.log(body);
await auth.updateUser(param.id, { ...body });
console.log(body);

Why does the user update overwrite the original object?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions