firebase / firebase/firebase-admin-node

auth.userUpdate() overwrite the original object

未关闭
#1,762 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: auth type: bug
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

### [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?

贡献指南

打开贡献指南

调研方向

从 auth.updateUser 开始,使用提供的更新前后对象复现,然后检查输入对象在调用期间在哪一处被修改。确认原始对象在更新后保持不变,并通过回归测试覆盖该行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, typescript
领域
authentication
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。