fix(api): update login endpoint

remove the `select` call so password validation doesn't fail
This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-11-12 16:39:23 -05:00
parent f049619178
commit b2c99726bc
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -7,7 +7,7 @@ import { doNotSelect } from "@server/constants";
export default eventHandler(async (event) => { export default eventHandler(async (event) => {
const wrongMsg = "wrong credentials"; const wrongMsg = "wrong credentials";
let reqbody = await readBody(event); 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(reqbody, { label: "login/body" });
// log.debug("USER -> " + user, { label: "login" }); // log.debug("USER -> " + user, { label: "login" });
// log.debug("conn ->" + mongoose.connection, { label: "login" }); // log.debug("conn ->" + mongoose.connection, { label: "login" });