Created
October 14, 2016 18:38
-
-
Save derzunov/a270f7bc25a24126d1b7d8322a93694c to your computer and use it in GitHub Desktop.
your_cool_project/config/passport.js
This file contains hidden or 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
var passport = require( 'passport' ), | |
FacebookStrategy = require( 'passport-facebook' ).Strategy; | |
passport.use( new FacebookStrategy({ | |
clientID: YOUR_CLIENT_ID, // Получить тут - https://developers.facebook.com/ | |
clientSecret: YOUR_CLIENT_SECRET, // Получить тут - https://developers.facebook.com/ | |
callbackURL: "/auth/callback", // Наш урл коллбэка в контроллере AuthController | |
enableProof: false, | |
profileFields: ['id', 'email', 'name'] // Поля, которые мы хотим получить у пользователя facebook | |
}, | |
function( accessToken, refreshToken, profile, cb ) { | |
User.findOrCreateByFacebook( profile, cb ); | |
} | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment