Skip to content

Commit

Permalink
feat:admin로그인 시 admin페이지 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
kim sun hong authored and sunhong06 committed Nov 4, 2023
1 parent 34f9f36 commit 434b468
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/hooks/@query/useSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export const useSignIn = () => {
accessToken: response.accessToken,
refreshToken: response.refreshToken,
});
if (response.name === '관리자') {
navigate('admin/CreateProblem');
}
dispatch(login());
alert('로그인 되었습니다.');
const get = userStorage.get();
if (get) {
if (response.name === '관리자') {
navigate('/admin/CreateProblem');
}
}
},
onError: () => {
alert('로그인에 실패했습니다.');
Expand Down

0 comments on commit 434b468

Please sign in to comment.