Skip to content

Commit d203dda

Browse files
committed
Returns merge error in the correct place.
1 parent 75b8a55 commit d203dda

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

FirebaseAuthUI/FUIAuth.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,18 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
175175
}
176176

177177
// Block to complete sign-in
178-
void (^completeSignInBlock)(FIRAuthDataResult *) = ^(FIRAuthDataResult *authResult){
178+
void (^completeSignInBlock)(FIRAuthDataResult *, NSError *) = ^(FIRAuthDataResult *authResult,
179+
NSError *error) {
179180
if (result) {
180181
result(authResult.user, nil);
181182
}
182183
// Hide Auth Picker Controller which was presented modally.
183184
if (isAuthPickerShown && presentingViewController.presentingViewController) {
184185
[presentingViewController dismissViewControllerAnimated:YES completion:^{
185-
[self invokeResultCallbackWithAuthDataResult:authResult error:nil];
186+
[self invokeResultCallbackWithAuthDataResult:authResult error:error];
186187
}];
187188
} else {
188-
[self invokeResultCallbackWithAuthDataResult:authResult error:nil];
189+
[self invokeResultCallbackWithAuthDataResult:authResult error:error];
189190
}
190191
};
191192

@@ -210,10 +211,9 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
210211
code:FUIAuthErrorCodeMergeConflict
211212
userInfo:userInfo];
212213
result(nil, mergeError);
213-
[self invokeResultCallbackWithAuthDataResult:nil error:mergeError];
214+
completeSignInBlock(authResult, mergeError);
214215
}
215216
}
216-
completeSignInBlock(authResult);
217217
}];
218218
} else {
219219
[self.auth signInAndRetrieveDataWithCredential:credential
@@ -234,7 +234,7 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
234234
}
235235
[self invokeResultCallbackWithAuthDataResult:nil error:error];
236236
} else {
237-
completeSignInBlock(authResult);
237+
completeSignInBlock(authResult, nil);
238238
}
239239
}];
240240
}

0 commit comments

Comments
 (0)