Skip to content

Commit 13d59e3

Browse files
committed
handles unstructured errors on redirect URLs
1 parent 4cf46e4 commit 13d59e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Example/Auth/Tests/FIRPhoneAuthProviderTests.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,7 @@ - (void)testVerifyPhoneNumberUIDelegateUnexpectedError {
732732
}
733733

734734
/** @fn testVerifyPhoneNumberUIDelegateUnstructuredError
735-
@brief Tests a invocation of @c verifyPhoneNumber:UIDelegate:completion: which results in an
736-
invalid client ID.
735+
@brief Tests a invocation of @c verifyPhoneNumber:UIDelegate:completion: which results in an error being surfaced due to an unexpected structure of the error response.
737736
*/
738737
- (void)testVerifyPhoneNumberUIDelegateUnstructuredError {
739738
id mockBundle = OCMClassMock([NSBundle class]);

Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ - (NSString *)reCAPTCHATokenForURL:(NSURL *)URL error:(NSError **)error {
267267
if(errorDict[@"code"] && errorDict[@"message"]) {
268268
reason = [NSString stringWithFormat:@"[%@] - %@",errorDict[@"code"], errorDict[@"message"]];
269269
} else {
270-
reason = @"An unknown error has occurred";
270+
reason = [NSString StringWithFormat:@"An unknown error occurred with the following "
271+
"response: %@", deepLinkURL];
271272
}
272273
*error = [FIRAuthErrorUtils appVerificationUserInteractionFailureWithReason:reason];
273274
}

0 commit comments

Comments
 (0)