Skip to content

Instantly share code, notes, and snippets.

@jackrobertscott
Last active December 10, 2019 11:15
Show Gist options
  • Save jackrobertscott/36122535169067a18db3daecd1bb962a to your computer and use it in GitHub Desktop.
Save jackrobertscott/36122535169067a18db3daecd1bb962a to your computer and use it in GitHub Desktop.
import * as queryString from 'query-string';
const stringifiedParams = queryString.stringify({
client_id: process.env.APP_ID_GOES_HERE,
redirect_uri: 'https://www.example.com/authenticate/facebook/',
scope: ['email', 'user_friends'].join(','), // comma seperated string
response_type: 'code',
auth_type: 'rerequest',
display: 'popup',
});
const facebookLoginUrl = `https://www.facebook.com/v4.0/dialog/oauth?${stringifiedParams}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment