diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m index 9e6252934ec..7273b85cda5 100644 --- a/Example/Auth/Tests/FIRAuthTests.m +++ b/Example/Auth/Tests/FIRAuthTests.m @@ -451,42 +451,6 @@ - (void)testFetchSignInMethodsForEmailSuccess { OCMVerifyAll(_mockBackend); } -/** @fn testFetchProvidersForEmailSuccessDeprecatedProviderID - @brief Tests the flow of a successful @c fetchProvidersForEmail:completion: call using the - deprecated FIREmailPasswordAuthProviderID. - */ -- (void)testFetchProvidersForEmailSuccessDeprecatedProviderID { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - NSArray *allProviders = - @[ FIRGoogleAuthProviderID, FIREmailAuthProviderID ]; -#pragma clang diagnostic pop - OCMExpect([_mockBackend createAuthURI:[OCMArg any] - callback:[OCMArg any]]) - .andCallBlock2(^(FIRCreateAuthURIRequest *_Nullable request, - FIRCreateAuthURIResponseCallback callback) { - XCTAssertEqualObjects(request.identifier, kEmail); - XCTAssertNotNil(request.endpoint); - XCTAssertEqualObjects(request.APIKey, kAPIKey); - dispatch_async(FIRAuthGlobalWorkQueue(), ^() { - id mockCreateAuthURIResponse = OCMClassMock([FIRCreateAuthURIResponse class]); - OCMStub([mockCreateAuthURIResponse allProviders]).andReturn(allProviders); - callback(mockCreateAuthURIResponse, nil); - }); - }); - XCTestExpectation *expectation = [self expectationWithDescription:@"callback"]; - [[FIRAuth auth] fetchProvidersForEmail:kEmail - completion:^(NSArray *_Nullable providers, - NSError *_Nullable error) { - XCTAssertTrue([NSThread isMainThread]); - XCTAssertEqualObjects(providers, allProviders); - XCTAssertNil(error); - [expectation fulfill]; - }]; - [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil]; - OCMVerifyAll(_mockBackend); -} - /** @fn testFetchProvidersForEmailFailure @brief Tests the flow of a failed @c fetchProvidersForEmail:completion: call. */ @@ -1135,45 +1099,6 @@ - (void)testSignInWithEmailCredentialSuccess { OCMVerifyAll(_mockBackend); } -/** @fn testSignInWithEmailCredentialSuccess - @brief Tests the flow of a successfully @c signInWithCredential:completion: call with an - email-password credential using the deprecated FIREmailPasswordAuthProvider. - */ -- (void)testSignInWithEmailCredentialSuccessWithDepricatedProvider { - OCMExpect([_mockBackend verifyPassword:[OCMArg any] callback:[OCMArg any]]) - .andCallBlock2(^(FIRVerifyPasswordRequest *_Nullable request, - FIRVerifyPasswordResponseCallback callback) { - XCTAssertEqualObjects(request.APIKey, kAPIKey); - XCTAssertEqualObjects(request.email, kEmail); - XCTAssertEqualObjects(request.password, kFakePassword); - XCTAssertTrue(request.returnSecureToken); - dispatch_async(FIRAuthGlobalWorkQueue(), ^() { - id mockVeriyPasswordResponse = OCMClassMock([FIRVerifyPasswordResponse class]); - [self stubTokensWithMockResponse:mockVeriyPasswordResponse]; - callback(mockVeriyPasswordResponse, nil); - }); - }); - [self expectGetAccountInfo]; - XCTestExpectation *expectation = [self expectationWithDescription:@"callback"]; - [[FIRAuth auth] signOut:NULL]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - FIRAuthCredential *emailCredential = - [FIREmailAuthProvider credentialWithEmail:kEmail password:kFakePassword]; -#pragma clang diagnostic pop - [[FIRAuth auth] signInWithCredential:emailCredential - completion:^(FIRAuthDataResult * _Nullable result, - NSError *_Nullable error) { - XCTAssertTrue([NSThread isMainThread]); - [self assertUser:result.user]; - XCTAssertNil(error); - [expectation fulfill]; - }]; - [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil]; - [self assertUser:[FIRAuth auth].currentUser]; - OCMVerifyAll(_mockBackend); -} - /** @fn testSignInWithEmailCredentialFailure @brief Tests the flow of a failed @c signInWithCredential:completion: call with an email-password credential. diff --git a/Firebase/Auth/Source/Auth Provider/Email/FIREmailAuthProvider.m b/Firebase/Auth/Source/Auth Provider/Email/FIREmailAuthProvider.m index ff7e0042ba0..373c0b141c1 100644 --- a/Firebase/Auth/Source/Auth Provider/Email/FIREmailAuthProvider.m +++ b/Firebase/Auth/Source/Auth Provider/Email/FIREmailAuthProvider.m @@ -18,8 +18,6 @@ #import "FIREmailPasswordAuthCredential.h" -// FIREmailPasswordAuthProviderID is defined in FIRAuthProvider.m. - NS_ASSUME_NONNULL_BEGIN @implementation FIREmailAuthProvider diff --git a/Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m b/Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m index e382d4e751a..33618505ae2 100644 --- a/Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m +++ b/Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m @@ -27,9 +27,6 @@ // Declared 'extern' in FIREmailAuthProvider.h NSString *const FIREmailAuthProviderID = @"password"; -// Declared 'extern' in FIREmailAuthProvider.h -NSString *const FIREmailPasswordAuthProviderID = @"password"; - // Declared 'extern' in FIRTwitterAuthProvider.h NSString *const FIRTwitterAuthProviderID = @"twitter.com"; diff --git a/Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m b/Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m index 5355a9f0749..b6988b799d7 100644 --- a/Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m +++ b/Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m @@ -37,10 +37,6 @@ NSString *const FIRAuthErrorUserInfoNameKey = @"FIRAuthErrorUserInfoNameKey"; -NSString *const FIRAuthErrorNameKey = @"error_name"; - -NSString *const FIRAuthUpdatedCredentialKey = @"FIRAuthUpdatedCredentialKey"; - /** @var kServerErrorDetailMarker @brief This marker indicates that the server error message contains a detail error message which should be used instead of the hardcoded client error message. @@ -753,11 +749,6 @@ + (NSError *)errorWithCode:(FIRAuthInternalErrorCode)code if (!errorUserInfo[NSLocalizedDescriptionKey]) { errorUserInfo[NSLocalizedDescriptionKey] = FIRAuthErrorDescription(errorCode); } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - // TODO(wangyue): Remove the deprecated code on next breaking change. - errorUserInfo[FIRAuthErrorNameKey] = FIRAuthErrorCodeString(errorCode); -#pragma clang diagnostic pop errorUserInfo[FIRAuthErrorUserInfoNameKey] = FIRAuthErrorCodeString(errorCode); return [NSError errorWithDomain:FIRAuthErrorDomain code:errorCode userInfo:errorUserInfo]; } else { @@ -957,11 +948,6 @@ + (NSError *)credentialAlreadyInUseErrorWithMessage:(nullable NSString *)message email:(nullable NSString *)email { NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; if (credential) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - // TODO(wangyue): Remove the deprecated code on next breaking change. - userInfo[FIRAuthUpdatedCredentialKey] = credential; -#pragma clang diagnostic pop userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey] = credential; } if (email.length) {