You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/auth/social-auth.mdx
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -496,7 +496,7 @@ with the new authentication state of the user.
496
496
497
497
To provide users with an additional login method, you can link their social media account (or an email & password) with their Firebase account.
498
498
This is possible for any social provider that uses `signInWithCredential()`.
499
-
To achieve this, you should replace sign-in method in any of the supported social sign-in code snippets with `getAuth().currentUser.linkWithCredential()`.
499
+
To achieve this, you should replace the sign-in method in any of the supported social sign-in code snippets with `linkWithCredential()` on the signed-in user. Ensure `getAuth().currentUser` is not null before linking.
500
500
501
501
This code demonstrates linking a Google provider to an account that is already signed in using Firebase authentication.
502
502
@@ -521,8 +521,13 @@ async function onGoogleLinkButtonPress() {
0 commit comments