Skip to content

Commit

Permalink
Merge pull request #147 from Myongji-Graduate/fix-login-error-message
Browse files Browse the repository at this point in the history
fix: update authentication error messages for better clarity
  • Loading branch information
seonghunYang authored Sep 21, 2024
2 parents 1126c68 + e11fe1d commit 30e3d2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/business/services/user/user.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ export async function authenticate(prevState: FormState, formData: FormData): Pr
}
} catch (error) {
// 명세와 다르게 에러가 발생할 경우 BadRequestError가 아니라 UnauthorizedError가 발생
if (error instanceof UnauthorizedError) {
if (error instanceof UnauthorizedError || error instanceof BadRequestError) {
// 잘못된 요청 처리 로직
return {
isSuccess: false,
isFailure: true,
validationError: {},
message: error.message,
message: '아이디 또는 비밀번호가 일치하지 않습니다.',
};
} else {
// 나머지 에러는 더 상위 수준에서 처리
Expand Down

0 comments on commit 30e3d2e

Please sign in to comment.