Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 0 additions & 75 deletions Example/Auth/Tests/FIRAuthTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString *> *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<NSString *> *_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.
*/
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#import "FIREmailPasswordAuthCredential.h"

// FIREmailPasswordAuthProviderID is defined in FIRAuthProvider.m.

NS_ASSUME_NONNULL_BEGIN

@implementation FIREmailAuthProvider
Expand Down
3 changes: 0 additions & 3 deletions Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
14 changes: 0 additions & 14 deletions Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down