Skip to content

Commit b92607b

Browse files
authored
Fix auto upgrade for oauth provider (#824)
1 parent 6d6dfd6 commit b92607b

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

Diff for: Auth/FirebaseAuthUI/FUIAuth.m

+4-8
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,11 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
237237
if (error) {
238238
// Check for "credential in use" conflict error and handle appropriately.
239239
if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) {
240-
FIRAuthCredential *newCredential = credential;
241-
// Check for and handle special case for Phone Auth Provider.
242-
if (providerUI.providerID == FIRPhoneAuthProviderID) {
243-
// Obtain temporary Phone Auth credential.
244-
newCredential = error.userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey];
240+
FIRAuthCredential *newCredential = error.userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey];
241+
NSDictionary *userInfo = @{ };
242+
if (newCredential) {
243+
userInfo = @{ FUIAuthCredentialKey : newCredential };
245244
}
246-
NSDictionary *userInfo = @{
247-
FUIAuthCredentialKey : newCredential,
248-
};
249245
NSError *mergeError = [FUIAuthErrorUtils mergeConflictErrorWithUserInfo:userInfo
250246
underlyingError:error];
251247
[self completeSignInWithResult:authResult

Diff for: EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ - (void)signInWithDefaultValue:(nullable NSString *)defaultValue
221221
}
222222

223223
- (void)signOut {
224-
224+
return;
225225
}
226226

227227
- (BOOL)handleOpenURL:(NSURL *)URL sourceApplication:(nullable NSString *)sourceApplication {

Diff for: OAuth/FirebaseOAuthUI/FUIOAuth.m

+1-10
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,7 @@ - (void)signInWithDefaultValue:(nullable NSString *)defaultValue
284284
}
285285

286286
- (void)signOut {
287-
FIRUser *user = _authUI.auth.currentUser;
288-
__weak UIViewController *weakController = self.presentingViewController;
289-
[user deleteWithCompletion:^(NSError * _Nullable error) {
290-
if (error) {
291-
__strong UIViewController *presentingViewController = weakController;
292-
[FUIAuthBaseViewController showAlertWithMessage:error.localizedDescription
293-
presentingViewController:presentingViewController];
294-
return;
295-
}
296-
}];
287+
return;
297288
}
298289

299290
- (BOOL)handleOpenURL:(NSURL *)URL sourceApplication:(nullable NSString *)sourceApplication {

Diff for: PhoneAuth/FirebasePhoneAuthUI/FUIPhoneAuth.m

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ - (void)signInWithDefaultValue:(nullable NSString *)defaultValue
165165
}
166166

167167
- (void)signOut {
168+
return;
168169
}
169170

170171
- (BOOL)handleOpenURL:(NSURL *)URL sourceApplication:(nullable NSString *)sourceApplication {

0 commit comments

Comments
 (0)