Skip to content

Commit

Permalink
Merge pull request #167 from MeeTeamNumdle/feature/#140_security_hand…
Browse files Browse the repository at this point in the history
…ling

feat: #140 신청자 관리 페이지 접근 권한 없을 때, 리다이렉션
  • Loading branch information
prgmr99 authored May 7, 2024
2 parents 88f78e1 + f2c039a commit c1caf1f
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 c1caf1f

Please sign in to comment.