firebase / firebase/firebase-js-sdk
FR: Make `getRedirectResult(auth)._tokenResponse` public to get firstName and lastName with Apple signup
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### [REQUIRED] Describe your environment
* Operating System version: any
* Browser version: any
* Firebase SDK version: 9.12.1
* Firebase Product: auth
### [REQUIRED] Describe the problem
When using Apple as a federated provider, there is no way to obtain `firstName` and `lastName`. We need both separated and cannot work just with `displayName`. While debugging we realised that with the following code we are able to obtain these attributes:
```javascript
const res = await getRedirectResult(auth)
const {firstName, lastName} = res._tokenResponse
```
But since `_tokenResponse` is clearly a private thing, we are a bit hesitant to use it (but will anyway for now. :-)).
Either make `_tokenResponse` a publicly available property or add `firstName` and `lastName` to the result of `getAdditionalUserInfo(redirect_result)`.
Contributor guide
Assessment
This issue has not been assessed yet.