I've been trying to convert an anonymous account to a permanent google account following the instructions on the firebase docs (https://firebase.google.com/docs/auth/web/anonymous-auth#google-sign-in)
It shows the following snippet of code:
import { GoogleAuthProvider } from "firebase/auth";
const credential = GoogleAuthProvider.credential(googleUser.getAuthResponse().id_token);
However, the snippet of code provided displays a variable called "googleUser" which has the method googleUser.getAuthResponse().id_token
I do not know where this variable comes from and how to get it. I've looked around the docs and internet for hours and had no luck.
I'm currently using linkWithPopup to do the job, however, if the google user that I'm trying to link the anonymous account to already exists on the app it just fails.