We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I am using facebook strategy with my Node-express app,
Sometimes if multiple users log in simultaneously, request object lost context and we get the wrong user details.
example of route app.get('/', isLoggedIncheck, checkIfFromFacebook, function(req, res) {
res.setHeader('x-auth-token1111', 'sfdsdf'); res.header('x-auth-token1111' , 'sfdsdf' ); // res.status(200).send(data.user); const data = {}; data.spath =req.protocol + '://' + req.hostname +':'+port+'/'; if (req.user != undefined) { data.user = req.user; data.user.token = jwt.sign({ id: req.user.userid, }, 'secret' ); res.cookie(req.user.username, JSON.stringify(data.user.token)); res.cookie(req.user.userid, JSON.stringify(data.user.token)); } else { data.user = ''; } data.server = req.hostname; data.min = min; data.id = generateId(); data.ver = version; data.port = port; data.path = '/explore'; data.page = 'explore'; data.curl =req.protocol + '://' + req.hostname; data.title = 'Woovly | Bucket List | Discover, Connect and Accomplish'; data.contrl = 'explore'; data.meta = {}; data.meta.storyL = {}; data.meta.storyL.name = 'home'; data.meta.storyL.title = ''; data.uuid = ""; data.is_set = ''; var htmlFile = ''; htmlFile = 'explore.html'; data.utyp = ''; res.render(htmlFile, { dt: data }); }); app.get("/getFeatured", checkIfFromFacebook, function(req, res) { const data = {}; data.spath =req.protocol + '://' + req.hostname +':'+port+'/'; if (req.user != undefined) { data.user = req.user; data.user.token = jwt.sign({ id: req.user.userid, }, 'secret' ); res.cookie(req.user.username, JSON.stringify(data.user.token)); res.cookie(req.user.userid, JSON.stringify(data.user.token)); } else { data.user = ''; } console.log(req.headers['x-key']); data.server = req.hostname; data.min = min; data.ver = version; data.port = port; data.path = "getFeatures"; data.page = "getFeatures"; data.curl =req.protocol + '://' + req.hostname+'/getFeatured'; data.title = "getFeatures"; data.contrl = "getFeatured"; data.is_set = ""; data.user_name = ""; data.uuid = ""; data.utyp = ""; data.meta = {}; res.render("getFeatures.html", { dt: data }); });
app.get('/auth/facebook', (req, res, next) => { req.session.redirect = req.query.location; passport.authenticate('facebook', { scope: ['user_friends', 'user_likes', 'email', 'user_birthday', 'user_location'] })(req, res, next) });
app.get( '/auth/facebook/callback', (req, res, next) => { console.log("****************"); console.log(req.session.redirect); if (req.session.redirect == undefined || req.session.redirect == 'undefined') req.session.redirect = '/'; passport.authenticate('facebook', { successRedirect: req.session.redirect, failureRedirect: '/', })(req, res, next) });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I am using facebook strategy with my Node-express app,
Sometimes if multiple users log in simultaneously, request object lost context and we get the wrong user details.
example of route
app.get('/', isLoggedIncheck, checkIfFromFacebook, function(req, res) {
app.get('/auth/facebook', (req, res, next) => {
req.session.redirect = req.query.location;
passport.authenticate('facebook', { scope: ['user_friends', 'user_likes', 'email', 'user_birthday', 'user_location'] })(req, res, next)
});
The text was updated successfully, but these errors were encountered: