auth 인증로그
This commit is contained in:
@@ -58,6 +58,9 @@ export class AuthService {
|
|||||||
throw new UnauthorizedException('아이디 또는 비밀번호가 틀렸습니다'); //HTTP 401 상태 코드 예외
|
throw new UnauthorizedException('아이디 또는 비밀번호가 틀렸습니다'); //HTTP 401 상태 코드 예외
|
||||||
}
|
}
|
||||||
// 3. 비밀번호 비교 (bcrypt)
|
// 3. 비밀번호 비교 (bcrypt)
|
||||||
|
const tempHash = await bcrypt.hash(userPassword, 10);
|
||||||
|
console.log('=========input password bcrypt hash========:', tempHash);
|
||||||
|
|
||||||
const isPasswordValid = await bcrypt.compare(userPassword, user.userPw);
|
const isPasswordValid = await bcrypt.compare(userPassword, user.userPw);
|
||||||
if (!isPasswordValid) {
|
if (!isPasswordValid) {
|
||||||
throw new UnauthorizedException('아이디 또는 비밀번호가 틀렸습니다');
|
throw new UnauthorizedException('아이디 또는 비밀번호가 틀렸습니다');
|
||||||
|
|||||||
Reference in New Issue
Block a user