Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Created March 25, 2021 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saltukalakus/2226d7fb3011b79509152b7df7ec7a07 to your computer and use it in GitHub Desktop.
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.
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