From 3990facff0fc9cb103c4e1bd3b52e6cb79550ad4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 12 Jun 2023 14:30:48 +0530 Subject: [PATCH] refactor: move the logic to findOne Signed-off-by: Pranav C --- packages/nocodb/src/services/auth.service.ts | 4 +--- packages/nocodb/src/services/users/users.service.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/services/auth.service.ts b/packages/nocodb/src/services/auth.service.ts index 9771d36b5c..287cb16391 100644 --- a/packages/nocodb/src/services/auth.service.ts +++ b/packages/nocodb/src/services/auth.service.ts @@ -13,9 +13,7 @@ import type { CreateUserDto } from '../controllers/auth.controller'; export class AuthService { constructor(private usersService: UsersService) {} - async validateUser(_email: string, pass: string): Promise { - const email = _email.toLowerCase(); - + async validateUser(email: string, pass: string): Promise { const user = await this.usersService.findOne(email); if (user) { const { password, salt, ...result } = user; diff --git a/packages/nocodb/src/services/users/users.service.ts b/packages/nocodb/src/services/users/users.service.ts index 0753329060..f76415708b 100644 --- a/packages/nocodb/src/services/users/users.service.ts +++ b/packages/nocodb/src/services/users/users.service.ts @@ -32,7 +32,8 @@ import type { export class UsersService { constructor(private metaService: MetaService) {} - async findOne(email: string) { + async findOne(_email: string) { + const email = _email.toLowerCase(); const user = await this.metaService.metaGet(null, null, MetaTable.USERS, { email, });