Fixed logout error

pull/2/head
Trivernis 5 years ago
parent e3c65f36b0
commit 1a918ddf64

@ -87,8 +87,14 @@ export function resolver(req: any, res: any): any {
} }
}, },
logout() { logout() {
if (req.session.user) { if (req.session.userId) {
delete req.session.user; delete req.session.userId;
req.session.save((err: any) => {
if (err) {
globals.logger.error(err.message);
globals.logger.debug(err.stack);
}
});
return true; return true;
} else { } else {
res.status(status.UNAUTHORIZED); res.status(status.UNAUTHORIZED);

Loading…
Cancel
Save