, free & fully virtual. June 9th - 10th. Register Now, free & fully virtual. June 9th - 10th. Register Now

Google Auth linking with Anon account

So, I have issue with linking my anonymous user accounts with Google provider. My process is following:

// 1) Anon user is created
if (!client.auth.isLoggedIn) {
 const user = await this._auth.loginWithCredential(new AnonymousCredential())

// 2) When user decide to login, I try to link them like that
this._auth.user.linkUserWithRedirect(new GoogleRedirectCredential()).then(user => console.log("I AM BACK", user)).catch(console.error)
// ^ this fails with following error
// error: "error exchanging access code with OAuth2 provider",
// error_code: "AuthError",
// link: ""
// }

// 3) I've found out on stack overflow that adding url to provider could solve that but I get CORS error if I try to do this
this._auth.user.linkUserWithRedirect(new GoogleRedirectCredential(window.location.href)).then(user => console.log("I AM BACK", user)).catch(console.error)
  1. I’ve also read that it may be because client IDs and secret IDs doesn’t match but I made sure 2 times that value here
    Are exactly the same as ones here

Any idea what could still be wrong?