hwihwi6108
02/14/2023, 9:15 PMrp_st
02/15/2023, 5:29 AMsattvikc
02/15/2023, 5:33 AMsattvikc
02/15/2023, 5:51 AMts
function CustomFacebook(config: any) : ThirdParty.TypeProvider {
const provider = ThirdParty.Facebook(config);
return {
...provider,
get: function (redirectURI, authCodeFromRequest, userContext) {
const getResult = provider.get(redirectURI, authCodeFromRequest, userContext)
return {
...getResult,
getProfileInfo: async function(authCodeResponse: any, userContext: any) {
const result = await getResult.getProfileInfo(authCodeResponse, userContext);
if (result.email === undefined) {
result.email = {
id: `${result.id}@facebook.fakeemail.com`,
isVerified: true,
}
}
return {
...result,
}
}
}
},
};
}
sattvikc
02/15/2023, 5:52 AMhwihwi6108
02/15/2023, 3:03 PM