diff options
author | Ivan <gonzalezivan@google.com> | 2017-10-23 11:38:29 -0700 |
---|---|---|
committer | Ivan <gonzalezivan@google.com> | 2017-10-23 11:38:29 -0700 |
commit | 9f6f9693345607198750d99892a21e2fdb77fc79 (patch) | |
tree | 1f2533b966e8ca8907a4d23ac4f9f0d1948593f4 /Firebase/Auth | |
parent | b561342aa69f30fbd5e66927501def426ba8337e (diff) |
handles unstructured errors on redirect URLs
Diffstat (limited to 'Firebase/Auth')
-rw-r--r-- | Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m | 2 | ||||
-rw-r--r-- | Firebase/Auth/Source/FIRAuthErrorUtils.h | 2 | ||||
-rw-r--r-- | Firebase/Auth/Source/FIRAuthErrorUtils.m | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m index 177ad9f..1242707 100644 --- a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m +++ b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m @@ -266,6 +266,8 @@ NSString *const kReCAPTCHAURLStringFormat = @"https://%@/__/auth/handler?%@"; NSString *reason; if(errorDict[@"code"] && errorDict[@"message"]) { reason = [NSString stringWithFormat:@"[%@] - %@",errorDict[@"code"], errorDict[@"message"]]; + } else { + reason = @"An unknown error has occurred"; } *error = [FIRAuthErrorUtils appVerificationUserInteractionFailureWithReason:reason]; } diff --git a/Firebase/Auth/Source/FIRAuthErrorUtils.h b/Firebase/Auth/Source/FIRAuthErrorUtils.h index af4ee28..c3fad0d 100644 --- a/Firebase/Auth/Source/FIRAuthErrorUtils.h +++ b/Firebase/Auth/Source/FIRAuthErrorUtils.h @@ -472,7 +472,7 @@ NS_ASSUME_NONNULL_BEGIN @param reason Reason for error, returned via URL response. @return The NSError instance associated with the given FIRAuthError. */ -+ (NSError *)appVerificationUserInteractionFailureWithReason:(nullable NSString *)reason; ++ (NSError *)appVerificationUserInteractionFailureWithReason:(NSString *)reason; /** @fn URLResponseErrorWithCode:message: @brief Constructs an @c NSError with the code and message provided. diff --git a/Firebase/Auth/Source/FIRAuthErrorUtils.m b/Firebase/Auth/Source/FIRAuthErrorUtils.m index 37f3a22..544fc5d 100644 --- a/Firebase/Auth/Source/FIRAuthErrorUtils.m +++ b/Firebase/Auth/Source/FIRAuthErrorUtils.m @@ -961,7 +961,7 @@ static NSString *const FIRAuthErrorCodeString(FIRAuthErrorCode code) { return [self errorWithCode:FIRAuthInternalErrorCodeWebContextCancelled message:message]; } -+ (NSError *)appVerificationUserInteractionFailureWithReason:(nullable NSString *)reason { ++ (NSError *)appVerificationUserInteractionFailureWithReason:(NSString *)reason { return [self errorWithCode:FIRAuthInternalErrorCodeAppVerificationUserInteractionFailure userInfo:@{ NSLocalizedFailureReasonErrorKey : reason |