firebase / firebase/firebase-admin-node

Importing user with phone providerData creates invalid user record

Đang mở
#2,141 0 bình luận 2 reaction 1 người được giao Được @renkelvin nhận Xem trên GitHub
api: auth
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
16

Mô tả

### [REQUIRED] Step 2: Describe your environment

* Operating System version: macOS Ventura 13
* Firebase SDK version: 11.6.0, 9.5.0
* Firebase Product: auth
* Node.js version: 16.16.0
* NPM version: 8.11.0

### [REQUIRED] Step 3: Describe the problem

#### Steps to reproduce:

When importing a user with a phone provider, the import is successful but it appears to create an invalid user account. When trying to fetch that user account (via `getUser`), it fails with the following error:

```
Error: INTERNAL ASSERT FAILED: Invalid user info response
```

However, importing the user with the `phoneNumber` in `UserImportRecord` but without the entry in `providerData` works. When fetching the user that it creates, the phone provider is there. So I suspect Firebase is implicitly creating the phone provider when `phoneNumber` is specified automatically, and specifying the `phone` provider in the import causes some sort of conflict.

#### Relevant Code:

```
const fireAuth = auth();

await fireAuth.importUsers(
[
{
uid: 'tLoo6OE5mrhwruQDJBugNU101234',
phoneNumber: '+12345678901',
providerData: [
{
uid: '+12345678901',
providerId: 'phone',
phoneNumber: '+12345678901'
}
],
}
],
);

// This will throw an error
console.log(await fireAuth.getUser('tLoo6OE5mrhwruQDJBugNU101234'));
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.