I am trying to get the multiples auth to link using singinwithredirect
. I grab the error .credential
and use JSON.stringify
to pass it through a cookie.
From there, I convert it back to an object by using JSON.parse
, but when I tried to pass the credential object into result.user.link(credential)
, it's giving me an error stating:
firebase.js:74 Uncaught Error: link failed: First argument "credential" must be a valid credential
Do I have to convert JSON object into a Firebase object in order to pass it in the credential? What the object originally looks like:
Ef {accessToken: "EAAQmrlAUQpEBAL4oiPWEJy.......", provider: "facebook.com"}
What the object looks like after converting back to JSON from cookie ('string')
:
Object {accessToken: "EAAQmrlAUQpEBAL4oiPWEJy.......", provider: "facebook.com"}