Created
March 25, 2021 16:25
-
-
Save saltukalakus/2226d7fb3011b79509152b7df7ec7a07 to your computer and use it in GitHub Desktop.
Prevents users from logging in if email isn't shared in their Facebook account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (user, context, callback) { | |
if (context.connection === "facebook" && !user.email) { | |
return callback(new UnauthorizedError("We can't access your email. Please enable sharing your e-mail from Facebook apps settings and re-try.")); | |
} | |
return callback(null, user, context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment