Skip to content

Commit

Permalink
✨ feat : 세션만료 (415) 코드 정정
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Apr 12, 2024
1 parent bfbdde8 commit f0266d1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/apis/config/privateApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ const privateApi: CustomInstance = axios.create({
privateApi.interceptors.response.use(
(response) => response.data,
(error) => {
if (error.response.status === 401) {
if (confirm('세션이 만료되었습니다. 다시 로그인해주세요!')) {
location.href = '/auth/logout';
}
if (error.response.status === 415) {
alert('세션이 만료되었어요. 다시 로그인이 필요해요!');
} else {
alert('오류가 발생했습니다. 다시 시도해주세요!');
alert('오류가 발생했어요. 다시 로그인해주세요!');
}
location.href = '/auth/logout';
return Promise.reject(error);
}
);
Expand Down

0 comments on commit f0266d1

Please sign in to comment.