aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth
diff options
context:
space:
mode:
authorGravatar Ivan <gonzalezivan@google.com>2017-10-23 11:38:29 -0700
committerGravatar Ivan <gonzalezivan@google.com>2017-10-23 11:38:29 -0700
commit9f6f9693345607198750d99892a21e2fdb77fc79 (patch)
tree1f2533b966e8ca8907a4d23ac4f9f0d1948593f4 /Firebase/Auth
parentb561342aa69f30fbd5e66927501def426ba8337e (diff)
handles unstructured errors on redirect URLs
Diffstat (limited to 'Firebase/Auth')
-rw-r--r--Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m2
-rw-r--r--Firebase/Auth/Source/FIRAuthErrorUtils.h2
-rw-r--r--Firebase/Auth/Source/FIRAuthErrorUtils.m2
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