diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-17 20:36:57 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-17 20:36:57 +0200 |
commit | 936c68f11161d6f03945bf81779d0d5fbf600222 (patch) | |
tree | 02a14e63c7e890b72c3bf1910da8ee163d2c43b8 | |
parent | :bug: fix import (diff) | |
download | server-936c68f11161d6f03945bf81779d0d5fbf600222.tar.xz |
:bug: fix login route
-rw-r--r-- | api/src/routes/auth/login.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/api/src/routes/auth/login.ts b/api/src/routes/auth/login.ts index 39ccf69c..a7247485 100644 --- a/api/src/routes/auth/login.ts +++ b/api/src/routes/auth/login.ts @@ -25,6 +25,8 @@ router.post( const query: any[] = [{ phone: login }]; if (email) query.push({ email }); + console.log(req.body, email); + const config = Config.get(); if (config.login.requireCaptcha && config.security.captcha.enabled) { @@ -42,10 +44,11 @@ router.post( const user = await UserModel.findOne( { $or: query }, - { user_data: { hash: true }, id: true, disabled: true, deleted: true, user_settings: { locale: true, theme: true } } + { "user_data.hash": true, id: true, disabled: true, deleted: true, "user_settings.locale": true, "user_settings.theme": true } ) .exec() .catch((e) => { + console.log(e, query); throw FieldErrors({ login: { message: req.t("auth:login.INVALID_LOGIN"), code: "INVALID_LOGIN" } }); }); |