Claim availability check #434

Merged
bones7242 merged 7 commits from claim-availability-check into master 2018-05-06 20:22:38 +02:00
2 changed files with 10 additions and 6 deletions
Showing only changes of commit d817ab02b0 - Show all commits

View file

@ -1,6 +1,10 @@
const logout = (req, res) => { const logout = (req, res) => {
req.logout(); req.logout();
res.status(200).json({success: true, message: 'you successfully logged out'}); const responseObject = {
success: true,
message: 'you successfully logged out'
};
res.status(200).json(responseObject);
}; };
module.exports = logout; module.exports = logout;

View file

@ -1,9 +1,9 @@
const user = (req, res) => { const user = (req, res) => {
if (req.user) { const responseObject = {
res.status(200).json({success: true, data: req.user}); success: true,
} else { data: req.user,
res.status(401).json({success: false, message: 'user is not logged in'}); };
} res.status(200).json(responseObject);
}; };
module.exports = user; module.exports = user;