Login endpoint now returns the user profile.
This commit is contained in:
@@ -16,7 +16,8 @@ UserController.post("/login", needDatabase, async (req, res) => {
|
||||
} else {
|
||||
req.session.userId = user._id;
|
||||
req.session.email = user.email;
|
||||
res.status(200).send("Authenticated.");
|
||||
user.password = undefined;
|
||||
res.status(200).send(user);
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.name === "TypeError") {
|
||||
|
Reference in New Issue
Block a user