Comments (2)
for more insights my code:
passport.use(new facebook({clientID: appconfig.fb.appID, clientSecret: appconfig.fb.appSecret,
callbackURL: "http://localhost:3000/fb"
},
function(accessToken, refreshToken, profile, done) {
console.log('access token : ',accessToken);
done(null,accessToken); // when this is commented out, middleware initialization error doenst come up. chaining isnt happening somewhere.
}
));
//...
...
app.get('/fb/auth',passport.authenticate('facebook')); //html page submits to /fb/auth -- this is working fine.
//...
...
function handleAccess(req,res,next){
passport.authenticate('facebook', {failureRedirect:'/error'} function(req,res){
console.log('test handle access');
next();
});
}
app.get('/fb',handleAccess,function(req,res,next){
res.send('tested');
});
from passport-facebook.
This function is wrong:
function handleAccess(req,res,next){
passport.authenticate('facebook', {failureRedirect:'/error'}, function(req,res){
console.log('test handle access');
next();
})(req, res, next); //<-- YOU NEED TO PASS REQ, RES, NEXT
}
If you are using the custom callback, you need to invoke passport.authenticate()(req, res, next) with the request, response, and next function.
See the documentation regarding custom callbacks here: http://passportjs.org/guide/authenticate/
from passport-facebook.
Related Issues (20)
- how to enable enable_profile_selector ?
- FacebookStrategy function is not working HOT 1
- Does passport-facebook work with https://github.com/facebook/react-native-fbsdk to retrieve refresh token?
- Logout_issue
- what if the user has multiple accounts on facebook and wanna switch to another account
- Hello HOT 1
- The re authenticate not working HOT 6
- i am getting an error of status code 500 from facebook
- Session Expired when using Passportjs Facebook from Facebook App in IOS HOT 1
- Hello
- Passport Facebook not redirecting correctly (Error Code 500) HOT 2
- instagram_basic permission getting ignored
- Warning Can't Load URL: HOT 2
- I am facing such issue anyone help me
- Facebook has detected that Secret isn't using a secure connection to transfer information.
- facebook login error : Sorry, something went wrong. We're working on getting this fixed as soon as we can. HOT 1
- FacebookToken Error via localhost HOT 2
- E11000 duplicate key error collection HOT 1
- Facebook allow Email scope not working, It's not return "email" ? HOT 4
- Lastest Facebook Version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passport-facebook.