Replies: 1 comment
-
Why don't you use the Facebook Provider that Auth.js provides by default, but define your own? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I follow this instructions https://authjs.dev/getting-started/authentication/oauth
but my facebook app version its 20.0 and the authJs v5 use 19.0 so every time my app are not the same with the facebook provider
export default function Facebook
(
options: OAuthUserConfig
): OAuthConfig
{
return {
id: "facebook",
name: "Facebook",
type: "oauth",
authorization: {
url: "https://www.facebook.com/v19.0/dialog/oauth",
params: {
scope: "email",
},
},
token: "https://graph.facebook.com/oauth/access_token",
userinfo: {
// https://developers.facebook.com/docs/graph-api/reference/user/#fields
url: "https://graph.facebook.com/me?fields=id,name,email,picture",
async request({ tokens, provider }) {
return await fetch(provider.userinfo?.url as URL, {
headers: { Authorization:
Bearer ${tokens.access_token}
},}).then(async (res) => await res.json())
},
},
profile(profile: P) {
return {
id: profile.id,
name: profile.name,
email: profile.email,
image: profile.picture.data.url,
}
},
style: { bg: "#006aff", text: "#fff" },
options,
}
}
Beta Was this translation helpful? Give feedback.
All reactions