Skip to content

Commit

Permalink
Merge pull request #84 from softeerbootcamp4th/fix-user-info-403-error
Browse files Browse the repository at this point in the history
[�Fix] 유저 정보 불러오는 중에 문제 로그인 정보 만료 시 clear 작업 진행
  • Loading branch information
nim-od authored Aug 19, 2024
2 parents 54e7390 + c7d0444 commit 642eae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/user/src/hooks/query/useGetUserInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type UserResponse = {
};

export default function useGetUserInfo() {
const { isAuthenticated, token } = useAuth();
const { isAuthenticated, token, clearAuthData } = useAuth();

const {
data: userInfo,
Expand All @@ -28,6 +28,7 @@ export default function useGetUserInfo() {

useEffect(() => {
if (status === 'error') {
clearAuthData();
throw new CustomError('유저 정보를 불러오는 중에 문제가 발생하였습니다.', 400);
}
}, [status]);
Expand Down

0 comments on commit 642eae5

Please sign in to comment.