Skip to content

Commit c357b17

Browse files
morganchen12Yue-Wang-Google
authored andcommitted
Fix issue where AuthResult callback would not be called on successful auto-upgrade (#519)
1 parent d99ff87 commit c357b17

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

FirebaseAuthUI/FUIAuth.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
296296
};
297297
NSError *mergeError = [FUIAuthErrorUtils mergeConflictErrorWithUserInfo:userInfo
298298
underlyingError:error];
299-
[self completeSignInWithResult:nil
299+
[self completeSignInWithResult:authResult
300300
error:mergeError
301301
presentingViewController:presentingViewController
302302
callback:callback];
@@ -336,6 +336,11 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
336336
callback(nil, error);
337337
}
338338
}
339+
} else {
340+
[self completeSignInWithResult:authResult
341+
error:nil
342+
presentingViewController:presentingViewController
343+
callback:callback];
339344
}
340345
}];
341346
}

FirebaseAuthUI/FUIAuthErrorUtils.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ + (NSError *)mergeConflictErrorWithUserInfo:(NSDictionary *)userInfo
3232
if (underlyingError != nil) {
3333
errorInfo[NSUnderlyingErrorKey] = underlyingError;
3434
}
35+
errorInfo[NSLocalizedDescriptionKey] = @"Unable to merge accounts. Check the userInfo dictionary"
36+
@" for the auth credential of the logged-in account.";
3537
return [self errorWithCode:FUIAuthErrorCodeMergeConflict userInfo:[errorInfo copy]];
3638
}
3739

0 commit comments

Comments
 (0)