node.js - re-login user with passport.js twitter login -


in passport have twitter authentication. fine login wise. have code

app.get('/auth/twitter', function (req, res) {     if (req.user) {         return res.redirect('/');     }     return passport.authenticate('twitter')(req, res); }); 

so if user logged in site twitter redirects back(probably give message eventually). once logout of site , click login twitter again takes them twitter authorize app page again. shouldn't. when @ other websites never asks me authorize app again. if in authorized app section of twitter profile see application i'm developing.

why application keep asking authorization when have given it? how can change this(i'm storing token , token_secret in db)? help.

i having same problem in development system, not in production.

the problem me traced application settings on twitter. when went twitter dev site , started compare selections made dev , prod systems, noticed difference on settings tab applications checkbox "allow application used sign in twitter" check-box not selected dev was prod system.

the tiny-print under check box on app settings tab says:

when enabled application can used "sign in twitter". when disabled application not able use /oauth/authenticate , request instead redirect user /oauth/authorize

the difference between authorize vs authenticate isn't clear terminology, authorize requires confirmation every time while authenticate "remembers" user's choice.

after made single change, dev system stopped asking me authorize-related confirmation every time tested logging in via twitter...


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -