firebase / firebase/firebase-js-sdk
FR: Surface auth credentials in `auth/admin-restricted-operation` error
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### Firebase SDK Version
10.7.2
### Describe the problem
As per the lines below, the response auth credentials are already surfaced for `FEDERATED_USER_ID_ALREADY_LINKED` errors so that the credential can be linked in a following operation.
https://github.com/firebase/firebase-js-sdk/blob/895d0cf981068cbfb74c40ac0e87b4e46096fdc1/packages/auth/src/api/index.ts#L191-L196
Now that there is a new setting to disable self-service user account creation, when a user signs in auth a federated provider when there is no existing account, then we get an `ADMIN_ONLY_OPERATION` error.
In such a case, we may want to initiate account creation via our own (admin) backend, and thereupon link the credentials to our new account. However this is currently impossible because the credentials are not surfaced.
Let's get the user credentials response surfaced with the error for `ADMIN_ONLY_OPERATION` in the same way as `FEDERATED_USER_ID_ALREADY_LINKED`?
Contributor guide
Assessment
This issue has not been assessed yet.