- 로그인 기능 오류 보완
This commit is contained in:
@@ -66,6 +66,7 @@ export class AccountController {
|
||||
@Public()
|
||||
@Post('login')
|
||||
async login(@Body() body: DTO.LoginRequest): Promise<DTO.LoginResponse> {
|
||||
console.log('a');
|
||||
const result = await this.accountService.login(body);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user