Skip to content

Commit 8e2293b

Browse files
authored
Add new method to update User's email (#956)
1 parent 42600cf commit 8e2293b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

auth/src/FirebaseUser.cs

+10
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,14 @@ public Task<string> TokenAsync(bool forceRefresh) {
278278
return GetValidFirebaseUserInternal().TokenAsync(forceRefresh);
279279
}
280280

281+
/// @deprecated This method is deprecated. Please use
282+
/// @ref SendEmailVerificationBeforeUpdatingEmailAsync(string) instead.
283+
///
281284
/// Sets the email address for the user.
282285
///
283286
/// May fail if there is already an email/password-based account for the same
284287
/// email address.
288+
[System.Obsolete("Please use `Task SendEmailVerificationBeforeUpdatingEmailAsync(string)` instead", false)]
285289
public Task UpdateEmailAsync(string email) {
286290
return GetValidFirebaseUserInternal().UpdateEmailAsync(email);
287291
}
@@ -309,6 +313,12 @@ public Task SendEmailVerificationAsync() {
309313
return GetValidFirebaseUserInternal().SendEmailVerificationAsync();
310314
}
311315

316+
/// Send an email to verify the ownership of the account, then update
317+
/// to the new email.
318+
public Task SendEmailVerificationBeforeUpdatingEmailAsync(string email) {
319+
return GetValidFirebaseUserInternal().SendEmailVerificationBeforeUpdatingEmailAsync(email);
320+
}
321+
312322
/// Updates a subset of user profile information.
313323
public Task UpdateUserProfileAsync(UserProfile profile) {
314324
return GetValidFirebaseUserInternal().UpdateUserProfileAsync(profile);

docs/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Release Notes
7474
### Upcoming release
7575
- Changes
7676
- General (Android): Improve how property tag logic handles Unity 2022+.
77+
- Auth: Add FirebaseUser.SendEmailVerificationBeforeUpdatingEmailAsync,
78+
a new method to verify and change the User's email.
79+
- Auth: Deprecate the older method of updating emails, UpdateEmail.
7780
- Dynamic Links: The Dynamic Links SDK is now deprecated. See the [support
7881
documentation](https://firebase.google.com/support/dynamic-links-faq)
7982
for more information.

0 commit comments

Comments
 (0)