From b2c99726bc7b2aa395ead1cb6f13e042be282c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 12 Nov 2024 16:39:23 -0500 Subject: [PATCH] fix(api): update login endpoint remove the `select` call so password validation doesn't fail --- server/api/auth/login.post.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/auth/login.post.ts b/server/api/auth/login.post.ts index a7e543c..c680c97 100644 --- a/server/api/auth/login.post.ts +++ b/server/api/auth/login.post.ts @@ -7,7 +7,7 @@ import { doNotSelect } from "@server/constants"; export default eventHandler(async (event) => { const wrongMsg = "wrong credentials"; let reqbody = await readBody(event); - let user = await User.findOne({ username: reqbody.username }).select(doNotSelect).exec(); + let user = await User.findOne({ username: reqbody.username }).exec(); // log.debug(reqbody, { label: "login/body" }); // log.debug("USER -> " + user, { label: "login" }); // log.debug("conn ->" + mongoose.connection, { label: "login" });