Skip to content

Commit ba5e708

Browse files
committed
Addresses comments
Addresses comments Minor enhances Fixes bug where wrong error is returned
1 parent 9140cb0 commit ba5e708

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

FirebaseAuthUI/FUIAuth.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ __attribute__((deprecated("Instead use authUI:didSignInWithAuthDataResult:error:
190190
*/
191191
@property(nonatomic, copy, nullable) NSURL *TOSURL;
192192

193-
/** @property autoUpgradeAnonymousUsers
193+
/** @property shouldAutoUpgradeAnonymousUsers
194194
@brief Whether to enable auto upgrading of anonymous accounts, defaults to NO.
195195
*/
196-
@property(nonatomic, assign, getter=isAutoUpgradeAnonymousUsers) BOOL autoUpgradeAnonymousUsers;
196+
@property(nonatomic, assign, getter=shouldAutoUpgradeAnonymousUsers) BOOL
197+
shouldAutoUpgradeAnonymousUsers;
197198

198199
/** @property delegate
199200
@brief A delegate that receives callbacks or provides custom UI for @c FUIAuth.

FirebaseAuthUI/FUIAuth.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
191191
};
192192

193193
// Check for the presence of an anonymous user and whether automatic upgrade is enabled.
194-
if (_auth.currentUser.isAnonymous && [FUIAuth defaultAuthUI].autoUpgradeAnonymousUsers) {
194+
if (_auth.currentUser.isAnonymous && [FUIAuth defaultAuthUI].shouldAutoUpgradeAnonymousUsers) {
195195
[_auth.currentUser
196196
linkAndRetrieveDataWithCredential:credential
197197
completion:^(FIRAuthDataResult *_Nullable authResult,
@@ -212,8 +212,8 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
212212
mergeError = [NSError errorWithDomain:FUIAuthErrorDomain
213213
code:FUIAuthErrorCodeMergeConflict
214214
userInfo:userInfo];
215-
result(nil, error);
216-
completeSignInBlock(authResult, error);
215+
result(nil, mergeError);
216+
completeSignInBlock(authResult, mergeError);
217217
} else {
218218
if (!isAuthPickerShown || error.code != FUIAuthErrorCodeUserCancelledSignIn) {
219219
[self invokeResultCallbackWithAuthDataResult:nil error:error];

samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ - (IBAction)onAuthUIDelegateChanged:(UISwitch *)sender {
229229

230230
- (IBAction)onAuthorization:(id)sender {
231231
if (!_auth.currentUser || _auth.currentUser.isAnonymous) {
232-
FUIAuth.defaultAuthUI.autoUpgradeAnonymousUsers = YES;
232+
FUIAuth.defaultAuthUI.shouldAutoUpgradeAnonymousUsers = YES;
233233
_authUI.providers = [self getListOfIDPs];
234234
_authUI.signInWithEmailHidden = ![self isEmailEnabled];
235235

@@ -266,7 +266,7 @@ - (void)authUI:(FUIAuth *)authUI
266266
FIRAuthCredential *credential = error.userInfo[FUIAuthCredentialKey];
267267
NSString *anonymousUserID = authUI.auth.currentUser.uid;
268268
NSString *messsage = [NSString stringWithFormat:@"A merge conflict occurred. The old user ID "
269-
"was: %@. You are now sig in with the following credential type: %@", anonymousUserID,
269+
"was: %@. You are now signed in with the following credential type: %@", anonymousUserID,
270270
[credential.provider uppercaseString]];
271271
[self showAlertWithTitlte:@"Merge Conflict" message:messsage];
272272
NSLog(@"%@", messsage);

0 commit comments

Comments
 (0)