File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -197,11 +197,13 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
197
197
completion: ^(FIRAuthDataResult *_Nullable authResult,
198
198
NSError * _Nullable error) {
199
199
if (error) {
200
- // Handle error cases
201
- NSError *mergeError;
202
- FIRAuthCredential *newCredential = credential;
200
+ // Check for "credential in use" conflict error and handle appropriately.
203
201
if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) {
202
+ NSError *mergeError;
203
+ FIRAuthCredential *newCredential = credential;
204
+ // Check for and handle special case for Phone Auth Provider.
204
205
if (providerUI.providerID == FIRPhoneAuthProviderID) {
206
+ // Obtain temporary Phone Auth provider.
205
207
newCredential = error.userInfo [FIRAuthUpdatedCredentialKey];
206
208
}
207
209
NSDictionary *userInfo = @{
@@ -233,9 +235,9 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
233
235
result (nil , error);
234
236
}
235
237
[self invokeResultCallbackWithAuthDataResult: nil error: error];
236
- } else {
237
- completeSignInBlock (authResult, nil );
238
+ return ;
238
239
}
240
+ completeSignInBlock (authResult, nil );
239
241
}];
240
242
}
241
243
}];
You can’t perform that action at this time.
0 commit comments