Home > OS >  How to get user profile URL of Facebook with Firebase Authentication?
How to get user profile URL of Facebook with Firebase Authentication?

Time:04-12

I follow the docs of Firebase for Facebook login, it work but i don't see anything relate user profile link of Facebook, Am i missing something?

code in the docs of Firebase.

import { getAuth, signInWithPopup, FacebookAuthProvider } from "firebase/auth";

const auth = getAuth();
signInWithPopup(auth, provider)
  .then((result) => {
    // The signed-in user info.
    const user = result.user;
    // I don't see any properties in user relate with user profile link of Facebook

    // This gives you a Facebook Access Token. You can use it to access the Facebook API.
    const credential = FacebookAuthProvider.credentialFromResult(result);
    const accessToken = credential.accessToken;

    // ...
  })
  .catch((error) => {
    console.log(error.message)

    // ...
  });

CodePudding user response:

There is no such URL provided. I suggest reviewing the documentation for the User interface and its UserInfo parent interface to find out what sort of data you have access to after the user signs in.

  • Related