trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
265 stars 141 forks source link

req.session.passport.user #91

Open ayyappaappana opened 8 years ago

ayyappaappana commented 8 years ago

Hi All, I am trying to implement sessions expiry part in my userLogin Data. After login, req.session is looking like.. { cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true }, passport: { user: '55f651370c0e9d1c0da51400' }, authenticated: true }

Config is something like : session: { secret: '757019661f534ea699ffefe7107e2654', adapter: 'mongo', host: 'localhost', port: 27017, db: 'productiondb', collection: 'sessions', cookie: { maxAge: 15_60_1000 } } After login we are assigning req.session.authenticated = true, manually, But now , my intension is too check at controller level for sessions using passport default methods like req.isAuthenticated() is giving false.

Where i am missing can anyone guide me. to solve and go farward with this module ASAP, it is a roadblock for my development.