Skip to content

Commit 3263f38

Browse files
fix: silently link accounts when there's a conflict
1 parent c03321b commit 3263f38

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ extension AuthPickerView: View {
7171
.onChange(of: authService.authenticationState) { _, newState in
7272
if newState == .authenticated {
7373
attemptAutoLinkPendingCredential()
74-
} else if newState == .unauthenticated {
75-
// Clear pending credential if user signs out
76-
pendingCredentialForLinking = nil
7774
}
7875
}
7976
}
@@ -92,7 +89,7 @@ extension AuthPickerView: View {
9289

9390
if shouldStoreCredential {
9491
// Extract the credential from the error and store it
95-
let credential = nsError.userInfo["FIRAuthUpdatedCredentialKey"] as? AuthCredential
92+
let credential = nsError.userInfo[AuthErrorUserInfoUpdatedCredentialKey] as? AuthCredential
9693
pendingCredentialForLinking = credential
9794
// Error still propagates to user via normal error modal
9895
}

0 commit comments

Comments
 (0)