|
|
|
@ -53,10 +53,10 @@ router.post("/login", async (req, res) => {
|
|
|
|
|
|
|
|
|
|
router.get("/profile", async (req, res) => { |
|
|
|
|
console.debug("Fetching profile for:", req.userId); |
|
|
|
|
let user = await User.findOne({ _id: req.userId }); |
|
|
|
|
let user = await User.query().findById(req.userId); |
|
|
|
|
|
|
|
|
|
if (user) { |
|
|
|
|
user.password = undefined; |
|
|
|
|
user.passwordHash = undefined; |
|
|
|
|
return res.json(user); |
|
|
|
|
} else { |
|
|
|
|
const message = "User not found"; |
|
|
|
|