2018-03-29 20:40:47 +02:00
|
|
|
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'});
|
|
|
|
}
|
2018-03-29 07:06:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = user;
|