You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In user.controller the login should not send the seponse and then return next(). This causes the error "Cannot set headers after they are sent to the client ".
it should be:
export function login(req, res, next) {
if (req.user) return res.status(200).json(req.user)
next()
}
instead of
export function login(req, res, next) {
res.status(200).json(req.user)
return next()
}
The text was updated successfully, but these errors were encountered:
In user.controller the login should not send the seponse and then return next(). This causes the error "Cannot set headers after they are sent to the client ".
it should be:
export function login(req, res, next) {
if (req.user) return res.status(200).json(req.user)
next()
}
instead of
export function login(req, res, next) {
res.status(200).json(req.user)
return next()
}
The text was updated successfully, but these errors were encountered: