firebase / firebase/firebase-android-sdk
Allow deleting secondary email addresses from the account
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 710
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 31
Description
## What feature would you like to see?
If a user has multiple email addresses linked to his/her account, allow deleting any of the secondary email address.
## Describe the feature you would like to add, ideally proposing a specific API.
Current API allows deleting providers only by `providerId `(ex. "google.com") which is not enough as there can be multiple email addresses sharing the same `providerId`. For example a user may have email addresses a@gmail.com, b@gmail.com and c@gmail.com linked to the same account and currently there is no way to delete the unnecessary email addresses.
As a related issue, it is unclear how `User.unlink` currently works if there are multiple email addresses with the same `providerId`.
I suggest either adding a new optional parameter `email` to the current API (`User.unlink`) or add a new API something like `User.unlinkWithEmail(String email)` or `User.removeEmail(String email)`.
## How would you use it?
I want to allow a user to update his/her email address to another one using the API `verifyBeforeUpdateEmail`. It is confusing if the old email address continues to work as before even if the user has updated the email address.
Currently if you use the API `verifyBeforeUpdateEmail`, the old email address is not removed but it stays as an additional authentication provider (actually not sure if this is a planned behavior or a bug). I would like to delete the old email address from the providers automatically after the `verifyBeforeUpdateEmail` has been successfully completed.
In addition I would like to display in the "Edit profile" page of my app the list of the linked email addresses and allow the user to delete any of them.
Contributor guide
Assessment
This issue has not been assessed yet.