I just found out about authentication tokens , which allows stateless / session servers to start with MEAN. It looks amazing.
Currently, I use Passport.jsto authenticate users (via email, Facebook, Google, ...), which stores information in a server session, like all tutorials:
app.use(express.session({
secret : 'superscret',
expires: new Date(+new Date + settings.session.sessionTimeout),
store: new MongoStore({})
}));
app.use(passport.initialize());
app.use(passport.session({}));
It can be used Passport.js, but instead of saving the session, it sends back a token to control whether the user has access.
Question . How to disconnect sessions for the passport? (I know how to send a token and listen to it).
source
share