firebase / firebase/firebase-admin-node
auth.userUpdate() overwrite the original object
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 16
Description
### [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: 'info2@basecloud.hu',
displayName: 'Basecloud',
phoneNumber: null,
role: 'user',
emailVerified: true,
disabled: false,
mfaRequired: false,
needChangePassword: false
}
```
#### Body after auth.updateUser
```
UserUpdateDto {
email: 'info2@basecloud.hu',
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?
Contributor guide
Research direction
Start at auth.updateUser using the provided before-and-after object reproduction, then inspect where the input object is changed during the call. Confirm that the original object remains unchanged after the update and cover that behavior with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100