I am not able to find any example or help to fetch in the currently logged in userid through Node API's.
Any help would be appreciated.
var memoryStore = new session.MemoryStore();
var routes = require('./routes/index');
var users = require('./routes/users');
app.use( session({
secret: 'aaslkdhlkhsd',
resave: false,
saveUninitialized: true,
store: memoryStore,
} ))
var keycloak = new Keycloak({
store: memoryStore
});
app.use( keycloak.middleware( {
logout: '/logout',
admin: '/',
} ));
Index.js
router.get('/',keycloak.protect(),function(req, res, next) {
res.sendfile('pages/index.html',{root:'./public'});
});
--
-- With best regards :-
Rushil Agarwal
Mobile: +91 78298 86000
Please don't print this e-mail unless you really need to. SAVE PAPER TO SAVE TREES