facebook does not include the user information in the profile of the beginning of the section

Viewed 18

I am establishing a login with facebook in nodejs and typescript, I want to save the information in a table called providers_section so that I can later grant permissions to those users, I have configured my app in facebook with the permissions for email and public profile, however when doing the login does not bring me that information.

these are the permissions of my facebook app, and as you can see it is in active mode.

Making a request from the facebook graph api; With my administrator account of the app, it brings me the email and the data that I require the object that facebook gives me

export const facebookStrategyName: string = "facebook";

let options: StrategyOptions = {
    clientID: config.facebookId,
    clientSecret: config.facebookSecret,
    callbackURL: config.facebookCallback,
    enableProof: true,
};

passport.use(
    facebookStrategyName,
    new Strategy(options, async (accessToken, refreshToken, profile, done) => {
        console.log(profile);

        await ProviderSection.findOrCreate({
            where: { uuid: profile.id },
            defaults: {
                provider: profile.provider,
                email: profile._json.email,
                uuid: profile._json.id,
                givenName: profile._json.given_name,
                familyName: profile._json.family_name,
                verified: profile._json.email_verified,
                roleId: 1,
            },
        });

        done(null, profile);
    })
);
0 Answers
Related