diff --git a/auth/src/android/user_android.cc b/auth/src/android/user_android.cc index 4e638a85db..62a9d1d936 100644 --- a/auth/src/android/user_android.cc +++ b/auth/src/android/user_android.cc @@ -41,8 +41,6 @@ METHOD_LOOKUP_DEFINITION(tokenresult, X(IsAnonymous, "isAnonymous", "()Z"), \ X(Token, "getIdToken", "(Z)Lcom/google/android/gms/tasks/Task;"), \ X(ProviderData, "getProviderData", "()Ljava/util/List;"), \ - X(UpdateEmail, "updateEmail", "(Ljava/lang/String;)" \ - "Lcom/google/android/gms/tasks/Task;"), \ X(VerifyBeforeUpdateEmail, "verifyBeforeUpdateEmail", \ "(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task;"), \ X(UpdatePassword, "updatePassword", "(Ljava/lang/String;)" \ @@ -353,26 +351,6 @@ std::vector User::provider_data() const { return provider_data; } -Future User::UpdateEmail(const char* email) { - if (!ValidUser(auth_data_)) { - return Future(); - } - ReferenceCountedFutureImpl& futures = auth_data_->future_impl; - const auto handle = futures.SafeAlloc(kUserFn_UpdateEmail); - JNIEnv* env = Env(auth_data_); - - jstring j_email = env->NewStringUTF(email); - jobject pending_result = env->CallObjectMethod( - UserImpl(auth_data_), user::GetMethodId(user::kUpdateEmail), j_email); - env->DeleteLocalRef(j_email); - - if (!CheckAndCompleteFutureOnError(env, &futures, handle)) { - RegisterCallback(pending_result, handle, auth_data_, nullptr); - env->DeleteLocalRef(pending_result); - } - return MakeFuture(&futures, handle); -} - Future User::UpdatePassword(const char* password) { if (!ValidUser(auth_data_)) { return Future(); diff --git a/auth/src/desktop/user_desktop.cc b/auth/src/desktop/user_desktop.cc index 6d8d0b5fd6..fb065e9f27 100644 --- a/auth/src/desktop/user_desktop.cc +++ b/auth/src/desktop/user_desktop.cc @@ -835,34 +835,6 @@ Future User::Reload() { callback); } -Future User::UpdateEmail(const char* const email) { - if (auth_data_ == nullptr) { // user is not valid - return Future(); // invalid future - } - Promise promise(&auth_data_->future_impl, kUserFn_UpdateEmail); - if (!ValidateCurrentUser(&promise, auth_data_)) { - return promise.LastResult(); - } - if (!ValidateEmail(&promise, email)) { - return promise.LastResult(); - } - if (!ValidateCurrentUser(&promise, auth_data_)) { - return promise.LastResult(); - } - - const char* language_code = nullptr; - auto auth_impl = static_cast(auth_data_->auth_impl); - if (!auth_impl->language_code.empty()) { - language_code = auth_impl->language_code.c_str(); - } - - typedef SetAccountInfoRequest RequestT; - auto request = RequestT::CreateUpdateEmailRequest( - *auth_data_->app, GetApiKey(*auth_data_), email); - return CallAsyncWithFreshToken(auth_data_, promise, std::move(request), - PerformSetAccountInfoFlow); -} - Future User::UpdatePassword(const char* const password) { if (auth_data_ == nullptr) { // user is not valid return Future(); // invalid future diff --git a/auth/src/include/firebase/auth/user.h b/auth/src/include/firebase/auth/user.h index 8e044e62e5..c58801cf26 100644 --- a/auth/src/include/firebase/auth/user.h +++ b/auth/src/include/firebase/auth/user.h @@ -229,20 +229,6 @@ class User : public UserInfoInterface { /// std::vector provider_data() const; - /// @deprecated This is a deprecated method. Please use - /// SendEmailVerificationBeforeUpdatingEmail(email) instead. - /// - /// Sets the email address for the user. - /// - /// May fail if there is already an email/password-based account for the same - /// email address. - FIREBASE_DEPRECATED Future UpdateEmail(const char* email); - - /// @deprecated - /// - /// Get results of the most recent call to UpdateEmail. - FIREBASE_DEPRECATED Future UpdateEmailLastResult() const; - /// Attempts to change the password for the current user. /// /// For an account linked to an Identity Provider (IDP) with no password, diff --git a/auth/src/ios/user_ios.mm b/auth/src/ios/user_ios.mm index f05bb23b14..2eb020307f 100644 --- a/auth/src/ios/user_ios.mm +++ b/auth/src/ios/user_ios.mm @@ -102,20 +102,6 @@ explicit IOSWrappedUserInfo(id user_info) : user_info_(user_info) { return provider_data; } -Future User::UpdateEmail(const char *email) { - if (!ValidUser(auth_data_)) { - return Future(); - } - ReferenceCountedFutureImpl &futures = auth_data_->future_impl; - const auto handle = futures.SafeAlloc(kUserFn_UpdateEmail); - [UserImpl(auth_data_) updateEmail:@(email) - completion:^(NSError *_Nullable error) { - futures.Complete(handle, AuthErrorFromNSError(error), - [error.localizedDescription UTF8String]); - }]; - return MakeFuture(&futures, handle); -} - Future User::UpdatePassword(const char *password) { if (!ValidUser(auth_data_)) { return Future(); diff --git a/auth/src/user.cc b/auth/src/user.cc index a271f008aa..4f48f6d7f0 100644 --- a/auth/src/user.cc +++ b/auth/src/user.cc @@ -20,7 +20,6 @@ namespace firebase { namespace auth { AUTH_RESULT_FN(User, GetToken, std::string) -AUTH_RESULT_FN(User, UpdateEmail, void) AUTH_RESULT_FN(User, UpdatePassword, void) AUTH_RESULT_FN(User, LinkWithCredential, AuthResult) AUTH_RESULT_FN(User, Reauthenticate, void) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 0ecbafb0d9..df62698523 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -677,6 +677,7 @@ code. ## Release Notes ### Upcoming Release - Changes + - Auth: Removed deprecated `User::UpdateEmail`. - iOS: Added an option to explicitly specify your app's `AppDelegate` class name via the `FirebaseAppDelegateClassName` key in `Info.plist`. This provides a more direct way for Firebase to interact with your specified