Replies: 4 comments
-
Yes, I would really like to get this functionality as I don't know how to use next auth at the moment while using facebook login for business |
Beta Was this translation helpful? Give feedback.
-
Dear @wbrijesh how are you? Do you need help to implement that? I don't know how can I help you but I'm willing too. |
Beta Was this translation helpful? Give feedback.
-
Any solution? |
Beta Was this translation helpful? Give feedback.
-
You can create your own custom provider. const FacebookBusinessProvider = {
id: "facebook_business",
name: "Facebook for Business",
type: "oauth",
authorization: {
url: "https://www.facebook.com/dialog/oauth",
params: {
scope:
"pages_show_list ads_management business_management pages_read_engagement pages_manage_posts email",
},
},
token: {
url: "https://graph.facebook.com/oauth/access_token",
},
userinfo: {
url: "https://graph.facebook.com/me",
params: { fields: "id,name,email,picture" },
async request({ tokens, client, provider }) {
return await client.userinfo(tokens.access_token!, {
// @ts-expect-error
params: provider.userinfo?.params,
});
},
},
clientId: env.FACEBOOK_CLIENT_ID,
clientSecret: env.FACEBOOK_CLIENT_SECRET,
profile(profile) {
return {
id: profile.id,
name: profile.name,
email: profile.email,
image: profile.picture.data.url,
};
},
} satisfies Provider; |
Beta Was this translation helpful? Give feedback.
-
Description 📓
There are two types of facebook apps, 1. login with facebook 2. business
In business apps you can add login for businees to get access to some feature, in my case ads_read and ads_management permissions
Purpose of the feature
Potential problems
Potential alternatives
How to reproduce ☕️
Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
Beta Was this translation helpful? Give feedback.
All reactions