Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

deploy: 접근권한 없는 페이지 접근 시, 로그인 페이지로 리다이렉션 - 배포 사이트 적용 #168

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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