Skip to content

Commit

Permalink
Merge pull request #168 from MeeTeamNumdle/release-1.0
Browse files Browse the repository at this point in the history
feat: 접근권한 없는 페이지 접근 시, 로그인 페이지로 리다이렉션 - 배포 사이트 적용
  • Loading branch information
prgmr99 authored May 7, 2024
2 parents 9edce8e + c1caf1f commit e891599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/service/axiosInstance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
import { CustomInstance } from '../types';
import qs from 'qs';
import { useNavigate } from 'react-router-dom';

const axiosConfig = {
baseURL: import.meta.env.VITE_BASE_URL,
Expand Down Expand Up @@ -31,6 +32,9 @@ const onError = (error: AxiosError) => {

if (response?.data) {
console.error(response.data);
if (response?.status === 400 || response?.status === 403) {
window.location.href = '/signin';
}
}

return Promise.reject(error);
Expand Down
1 change: 1 addition & 0 deletions src/service/recruit/applicant.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useNavigate } from 'react-router-dom';
import {
ApplicantList,
ApplicantPageInfo,
Expand Down

0 comments on commit e891599

Please sign in to comment.