Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/potenday-project/pot…
Browse files Browse the repository at this point in the history
…en_312_N6FE into development
  • Loading branch information
nononcrust committed Dec 15, 2023
2 parents 0c6ad3a + e5ac084 commit f2e949c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
REACT_APP_NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
REACT_APP_NAVER_REDIRECT_URI: ${{ secrets.NAVER_REDIRECT_URI }}
REACT_APP_KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
echo "REACT_APP_REGION=$REACT_APP_REGION" >> .env.production
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
REACT_APP_NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
REACT_APP_NAVER_REDIRECT_URI: ${{ secrets.NAVER_REDIRECT_URI }}
REACT_APP_KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
Expand Down
11 changes: 11 additions & 0 deletions src/component/home/KakaoOauth.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { useEffect } from 'react';
import { useLocation } from 'react-router';
import instance from 'shared/axios';

export default function KakaoOauth() {
const location = useLocation();
const urlParams = new URLSearchParams(location.search);
const codeValue = urlParams.get('code');

const Login = async () => {
const response = await instance.post(`/api/user/kakao?code=${codeValue}`);
return response;
};

useEffect(() => {
console.log(Login());
}, []);

return <>카카오 리다이렉트 페이지</>;
}
11 changes: 11 additions & 0 deletions src/component/home/NaverOauth.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { useEffect } from 'react';
import { useLocation } from 'react-router';
import instance from 'shared/axios';

export default function NaverOauth() {
const location = useLocation();
const urlParams = new URLSearchParams(location.search);
const codeValue = urlParams.get('code');

const Login = async () => {
const response = await instance.post(`/api/user/naver?code=${codeValue}`);
return response;
};

useEffect(() => {
console.log(Login());
}, []);

return <>네이버 리다이렉트 페이지</>;
}
4 changes: 2 additions & 2 deletions src/shared/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ instance.interceptors.response.use(
return axios(originalRequest);
}
if (response.status === 404) {
return window.location.replace('/notfound');
// return window.location.replace('/notfound');
}
if (response.status === 504) {
return window.location.replace('/connectfail');
// return window.location.replace('/connectfail');
}
if (response.status === 400) {
return response;
Expand Down

0 comments on commit f2e949c

Please sign in to comment.