diff --git a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h index 362ed293231..07bfa7c93f3 100644 --- a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h +++ b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h @@ -378,7 +378,9 @@ NS_SWIFT_NAME(Auth) /** @fn fetchSignInMethodsForEmail:completion: @brief Fetches the list of all sign-in methods previously used for the provided email address. - + This method returns an empty list when [Email Enumeration + Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) + is enabled, irrespective of the number of authentication methods available for the given email. @param email The email address for which to obtain a list of sign-in methods. @param completion Optionally; a block which is invoked when the list of sign in methods for the specified email address is ready or an error was encountered. Invoked asynchronously on the @@ -393,10 +395,15 @@ NS_SWIFT_NAME(Auth) - (void)fetchSignInMethodsForEmail:(NSString *)email completion:(nullable void (^)(NSArray *_Nullable, - NSError *_Nullable))completion; + NSError *_Nullable))completion + DEPRECATED_MSG_ATTRIBUTE( + "This method returns an empty list when Email Enumeration Protection is enabled."); /** @fn signInWithEmail:password:completion: - @brief Signs in using an email address and password. + @brief Signs in using an email address and password. When [Email Enumeration + Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) + is enabled, this method fails with "auth/invalid-credential" in case of an invalid + email/password. @param email The user's email address. @param password The user's password. @@ -663,8 +670,10 @@ NS_SWIFT_NAME(Auth) - (void)applyActionCode:(NSString *)code completion:(void (^)(NSError *_Nullable error))completion; /** @fn sendPasswordResetWithEmail:completion: - @brief Initiates a password reset for the given email address. - + @brief Initiates a password reset for the given email address. This method does not throw an + error when [Email Enumeration + Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) + is enabled. @param email The email address of the user. @param completion Optionally; a block which is invoked when the request finishes. Invoked asynchronously on the main thread in the future. diff --git a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h index 9fb1fbb2701..c4ffb2e1e0e 100644 --- a/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h +++ b/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h @@ -132,7 +132,9 @@ NS_SWIFT_NAME(User) /** @fn updateEmail:completion: @brief Updates the email address for the user. On success, the cached user profile data is - updated. + updated. Throws "auth/operation-not-allowed" error when [Email Enumeration + Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) + is enabled. @remarks May fail if there is already an account with this email address that was created using email and password authentication. @@ -160,7 +162,9 @@ NS_SWIFT_NAME(User) */ - (void)updateEmail:(NSString *)email completion:(nullable void (^)(NSError *_Nullable error))completion - NS_SWIFT_NAME(updateEmail(to:completion:)); + NS_SWIFT_NAME(updateEmail(to:completion:)) + DEPRECATED_MSG_ATTRIBUTE("Use verifyBeforeUpdateEmail() instead."); +; /** @fn updatePassword:completion: @brief Updates the password for the user. On success, the cached user profile data is updated.