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() {
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);

Loading…
Cancel
Save