Skip to content

Cannot set headers after they are sent to the client  #14

@FelixRe0

Description

@FelixRe0

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions