Skip to content

Commit

Permalink
[BUG] Failed Auth in Login page throws an exemption #167
Browse files Browse the repository at this point in the history
  • Loading branch information
ballyalley-o committed May 7, 2024
1 parent 1a71bef commit e9b3285
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/page/auth/log-in/log-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ function LogIn() {
localStorage.removeItem(LOCAL_STORAGE.USER_INFO)
}
} else {
console.log('ERROR 1', RESPONSE.error.INVALID_CREDENTIAL)
snack(RESPONSE.error.INVALID_CREDENTIAL, {
variant: COLOR.ERROR
})
console.log('ERROR 2', RESPONSE.error.INVALID_CREDENTIAL)
throw new Error(RESPONSE.error.INVALID_CREDENTIAL)
}
} catch (error: any) {
console.error('error : ', error || '')
snack(error?.data?.message, { variant: COLOR.ERROR })
// console.log('ERROR 3', error)
snack(RESPONSE.error.INVALID_CREDENTIAL, { variant: COLOR.ERROR })
reset()
if (error.message === RESPONSE.error.INVALID_CREDENTIAL) {
setError(KEY.EMAIL, { message: RESPONSE.error.EMAIL_INVALID })
setError(KEY.PASSWORD, { message: RESPONSE.error.PASSWORD_INVALID })
} else {
snack(error.message, {
snack(RESPONSE.error.INVALID_CREDENTIAL, {
variant: COLOR.ERROR
})
setError(KEY.EMAIL, { message: error.message })
Expand Down

0 comments on commit e9b3285

Please sign in to comment.