diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:52:42 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:52:42 +0200 |
commit | ce6363909015eae9ff19389f0b929ab5e56a096f (patch) | |
tree | 4b09029da3a3bc9219391075282b68a291833ba0 /api/src/routes/auth/register.ts | |
parent | :art: reformatted (diff) | |
download | server-ce6363909015eae9ff19389f0b929ab5e56a096f.tar.xz |
:bug: fix user projection
Diffstat (limited to 'api/src/routes/auth/register.ts')
-rw-r--r-- | api/src/routes/auth/register.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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({ |