Skip to content

Commit

Permalink
fix: 로그인 실패시 에러메시지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiWonBeen committed Mar 3, 2024
1 parent a2e1477 commit 9f61098
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/Auth/LoginPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useBooleanState from 'utils/hooks/useBooleanState';
import { auth } from 'api';
import sha256 from 'utils/ts/SHA-256';
import showToast from 'utils/ts/showToast';
import { AxiosError } from 'axios';
import styles from './LoginPage.module.scss';

interface IClassUser {
Expand Down Expand Up @@ -41,6 +42,9 @@ const useLogin = (state: IsAutoLogin) => {
setToken(data.token);
navigate('/');
},
onError: (error: AxiosError<{ message: string }>) => {
showToast('error', error.response?.data?.message || '로그인에 실패했습니다.');
},
});

const login = async (userInfo: UserInfo) => {
Expand Down

0 comments on commit 9f61098

Please sign in to comment.