Hello SuperTokens Team, I am using ThirdPartyPassw...
# support-questions-legacy
h
Hello SuperTokens Team, I am using ThirdPartyPasswordless with Facebook. As my user's facebook account is using phone number + password to login for itself without email, so supertokens-node return NO_EMAIL_GIVEN_BY_PROVIDER, any ideas to work around with this problem?
r
hey @hwihwi6108 - @sattvikc can help here.
s
hey, will get back in a while
Copy code
ts
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,
                    }
                }
            }
        },
    };
}
this should help you with the login. please note that Facebook won't provide the phone number of the user.
h
Thanks @sattvikc for providing details code
2 Views