diff --git a/src/modules/account/account.controller.ts b/src/modules/account/account.controller.ts index 1805670..bedb347 100644 --- a/src/modules/account/account.controller.ts +++ b/src/modules/account/account.controller.ts @@ -66,6 +66,7 @@ export class AccountController { @Public() @Post('login') async login(@Body() body: DTO.LoginRequest): Promise { + console.log('a'); const result = await this.accountService.login(body); return result; } diff --git a/src/modules/account/account.repo.ts b/src/modules/account/account.repo.ts index 0bcaaa1..58e5fea 100644 --- a/src/modules/account/account.repo.ts +++ b/src/modules/account/account.repo.ts @@ -42,16 +42,13 @@ export class AccountRepo { type: 'email' | 'accountId' , id: string ) { - const condition = type === 'email' - ? eq(schema.account.email, id) - : eq(schema.account.accountId, id); return this .db .select() .from(schema.account) .where( and( - condition, + eq(schema.account[type], id), eq(schema.account.isDeleted, false), eq(schema.account.status, 'active') ) diff --git a/src/modules/account/account.service.ts b/src/modules/account/account.service.ts index 51d3fe8..190bf6b 100644 --- a/src/modules/account/account.service.ts +++ b/src/modules/account/account.service.ts @@ -78,9 +78,6 @@ export class AccountService { const queryResult = await this.accountRepo.login(type, id); const typeValue = type === 'email' ? '이메일' : '아이디'; - - console.log(queryResult); - if (!queryResult || (queryResult.length < 1)) { return { success: false, @@ -88,7 +85,6 @@ export class AccountService { }; } - const hashedPassword = queryResult[0].password; const isPasswordMatch = Converter.comparePassword(password, hashedPassword); if (!isPasswordMatch) {