From e3c65f36b0768220ccfd6489ca3cc2afec8012c8 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Fri, 18 Oct 2019 15:18:11 +0200 Subject: [PATCH 1/2] Added level to file logs --- src/lib/globals.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/globals.ts b/src/lib/globals.ts index 8e8c30b..9063c49 100644 --- a/src/lib/globals.ts +++ b/src/lib/globals.ts @@ -52,6 +52,7 @@ namespace globals { }), ), json: false, + level: config.logging.level, maxFiles: "7d", zippedArchive: true, }), From 1a918ddf6461d69d14e1225889587e112c603414 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Tue, 29 Oct 2019 11:01:19 +0100 Subject: [PATCH 2/2] Fixed logout error --- src/graphql/resolvers.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/graphql/resolvers.ts b/src/graphql/resolvers.ts index 44ea21d..4fa7f1f 100644 --- a/src/graphql/resolvers.ts +++ b/src/graphql/resolvers.ts @@ -87,8 +87,14 @@ export function resolver(req: any, res: any): any { } }, logout() { - if (req.session.user) { - delete req.session.user; + if (req.session.userId) { + delete req.session.userId; + req.session.save((err: any) => { + if (err) { + globals.logger.error(err.message); + globals.logger.debug(err.stack); + } + }); return true; } else { res.status(status.UNAUTHORIZED);