Skip to content

Commit fcd4854

Browse files
committed
Adds comments and minor changes
1 parent d203dda commit fcd4854

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

FirebaseAuthUI/FUIAuth.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,13 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
197197
completion:^(FIRAuthDataResult *_Nullable authResult,
198198
NSError * _Nullable error) {
199199
if (error) {
200-
// Handle error cases
201-
NSError *mergeError;
202-
FIRAuthCredential *newCredential = credential;
200+
// Check for "credential in use" conflict error and handle appropriately.
203201
if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) {
202+
NSError *mergeError;
203+
FIRAuthCredential *newCredential = credential;
204+
// Check for and handle special case for Phone Auth Provider.
204205
if (providerUI.providerID == FIRPhoneAuthProviderID) {
206+
// Obtain temporary Phone Auth provider.
205207
newCredential = error.userInfo[FIRAuthUpdatedCredentialKey];
206208
}
207209
NSDictionary *userInfo = @{
@@ -233,9 +235,9 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
233235
result(nil, error);
234236
}
235237
[self invokeResultCallbackWithAuthDataResult:nil error:error];
236-
} else {
237-
completeSignInBlock(authResult, nil);
238+
return;
238239
}
240+
completeSignInBlock(authResult, nil);
239241
}];
240242
}
241243
}];

0 commit comments

Comments
 (0)