Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Development #7

Merged
merged 8 commits into from
Dec 15, 2023
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
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# vscode
.vscode
160 changes: 64 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@tanstack/react-query": "^5.13.4",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -14,13 +15,13 @@
"dayjs": "^1.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-query": "^3.39.3",
"react-router-dom": "^6.20.1",
"react-scripts": "5.0.1",
"recoil": "^0.7.7",
"styled-components": "^6.1.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"yup": "^1.3.3"
},
"scripts": {
"start": "react-scripts start",
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 <>네이버 리다이렉트 페이지</>;
}
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import './index.css';
import reportWebVitals from './reportWebVitals';
import { RouterProvider } from 'react-router-dom';
import { router } from './routes/Router';
import { QueryClient, QueryClientProvider } from 'react-query';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RecoilRoot } from 'recoil';
import { GlobalStyle } from 'styles/globalStyles';

Expand Down
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