Updated code for getCurrentUserDetails control findByID

master
parent cb146e61d4
commit b3f4cef1d7

@ -66,7 +66,7 @@ module.exports.loginUser = (request, response) => {
// get current user details controller. // get current user details controller.
exports.getCurrentUserDetails = async (req, res) => { exports.getCurrentUserDetails = async (req, res) => {
try { try {
const user = await User.findById(req.user.id, 'email'); const user = await User.findById(req.user.id);
if (!user) { if (!user) {
return res.status(404).json({ message: 'User not found' }); return res.status(404).json({ message: 'User not found' });

Loading…
Cancel
Save