diff options
author | Xiangtian Dai <xiangtian@google.com> | 2017-09-21 11:25:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 11:25:32 -0700 |
commit | 64462179c34df4606b62c7943818c1e8ace9a81f (patch) | |
tree | 00fe6824561105bdeb2f1b179e8202b5cff05c6c /Firebase | |
parent | 2c4233cfe14af72d420658068ed1b3f08906c478 (diff) |
Fixes a threading issue when calling back with an error for phone number auth. (#298)
Also changes the sample app to be able to test this case.
Diffstat (limited to 'Firebase')
-rw-r--r-- | Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m index 0a59d52..177ad9f 100644 --- a/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m +++ b/Firebase/Auth/Source/AuthProviders/Phone/FIRPhoneAuthProvider.m @@ -149,11 +149,11 @@ NSString *const kReCAPTCHAURLStringFormat = @"https://%@/__/auth/handler?%@"; BOOL isInvalidAppCredential = error.code == FIRAuthErrorCodeInternalError && underlyingError.code == FIRAuthErrorCodeInvalidAppCredential; if (error.code != FIRAuthErrorCodeMissingAppToken && !isInvalidAppCredential) { - completion(nil, error); + callBackOnMainThread(nil, error); return; } NSMutableString *eventID = [[NSMutableString alloc] init]; - for(int i=0; i<10; i++) { + for (int i=0; i<10; i++) { [eventID appendString: [NSString stringWithFormat:@"%c", 'a' + arc4random_uniform('z' - 'a' + 1)]]; } |