spee.ch/server/controllers/auth/user/index.js
2018-04-27 14:29:00 -07:00

9 lines
226 B
JavaScript

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