From ce6363909015eae9ff19389f0b929ab5e56a096f Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:52:42 +0200 Subject: :bug: fix user projection --- api/src/routes/auth/register.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api/src/routes/auth') diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts index c016c949..9f3b46f1 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts @@ -79,7 +79,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re if (!register.allowMultipleAccounts) { // TODO: check if fingerprint was eligible generated - const exists = await User.findOne({ where: { fingerprints: body.fingerprint } }); + const exists = await User.findOne({ where: { fingerprints: body.fingerprint }, select: ["id"] }); if (exists) { throw FieldErrors({ @@ -109,7 +109,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re } // check if there is already an account with this email - const exists = await User.findOneOrFail({ email: email }).catch((e) => {}); + const exists = await User.findOne({ email: email }); if (exists) { throw FieldErrors({ -- cgit 1.5.1