Skip to content

Commit

Permalink
유저 정보 조회 오류 최종 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcgrdn committed Nov 20, 2024
1 parent cae1e07 commit dace9cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/provider/userProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export function UserProvider({ children }: { children: React.ReactNode }) {

const fetchUser = async () => {
try {
setIsLoading(true);
const { data } = await api.get<Artist>("/artist");
setUser(data);
} catch (err) {
if (err instanceof AxiosError) {
if (err.response?.status === 401) {
// 인증 에러일 경우 로그아웃 상태로 처리
setIsLoggedIn(false);
setUser(null);
}
Expand Down

0 comments on commit dace9cd

Please sign in to comment.