Fixed get session by id
This commit is contained in:
@@ -30,7 +30,7 @@ function getRouter(options) {
|
|||||||
const sessionStore = req.sessionStore;
|
const sessionStore = req.sessionStore;
|
||||||
if (sessionStore) {
|
if (sessionStore) {
|
||||||
const getSession = util_1.promisify(sessionStore.get);
|
const getSession = util_1.promisify(sessionStore.get);
|
||||||
const session = yield getSession(sessionId);
|
const session = yield getSession.call(sessionStore, sessionId);
|
||||||
if (session) {
|
if (session) {
|
||||||
sessionStore.createSession(req, session);
|
sessionStore.createSession(req, session);
|
||||||
return true; // success
|
return true; // success
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function getRouter(options?: Partial<session.SessionOptions>): RequestHandler {
|
|||||||
const sessionStore = (req as { sessionStore?: session.Store }).sessionStore;
|
const sessionStore = (req as { sessionStore?: session.Store }).sessionStore;
|
||||||
if (sessionStore) {
|
if (sessionStore) {
|
||||||
const getSession = promisify(sessionStore.get);
|
const getSession = promisify(sessionStore.get);
|
||||||
const session = await getSession(sessionId);
|
const session = await getSession.call(sessionStore, sessionId);
|
||||||
if (session) {
|
if (session) {
|
||||||
sessionStore.createSession(req, session);
|
sessionStore.createSession(req, session);
|
||||||
return true; // success
|
return true; // success
|
||||||
|
|||||||
Reference in New Issue
Block a user