From 53bd2cfd3387e10204df65ea6d306997c04ed94b Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 3 Sep 2018 11:46:36 +0100 Subject: [PATCH] Add error handling on logout --- services/web/app/coffee/Features/User/UserController.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/User/UserController.coffee b/services/web/app/coffee/Features/User/UserController.coffee index 22af41db6a..70d61a91b2 100644 --- a/services/web/app/coffee/Features/User/UserController.coffee +++ b/services/web/app/coffee/Features/User/UserController.coffee @@ -133,8 +133,9 @@ module.exports = UserController = SudoModeHandler.clearSudoMode(user._id) cb() - logout : (req, res)-> + logout : (req, res, next)-> UserController._doLogout req, (err) -> + return next(err) if err? res.redirect '/login' register : (req, res, next = (error) ->)->