Skip to content

Commit

Permalink
Fix: redirect_uri 재설정
Browse files Browse the repository at this point in the history
  • Loading branch information
in63119 committed Nov 18, 2023
1 parent b7e92ae commit 2fb8546
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions Front-end/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
REACT_APP_KAKAO_API_KEY=

REACT_APP_SERVER_URL=
REACT_APP_LOCAL_REDIRECT_URI=
REACT_APP_PROD_REDIRECT_URI=

# DB : Firebase
REACT_APP_FIREBASE_API_KEY=
Expand Down
3 changes: 1 addition & 2 deletions Front-end/src/apis/kakao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ axios.defaults.withCredentials = true;

const apiKey = process.env.REACT_APP_KAKAO_API_KEY;
const currentUrl = window.location.host;
const { REACT_APP_LOCAL_REDIRECT_URI, REACT_APP_PROD_REDIRECT_URI } = process.env;
const redirect_uri = currentUrl === 'localhost:3000' ? REACT_APP_LOCAL_REDIRECT_URI : REACT_APP_PROD_REDIRECT_URI;
const redirect_uri = currentUrl === 'localhost:3000' ? 'http://localhost:3000/callback' : 'https://kirok.net/callback';
const kakaoUri = `https://kauth.kakao.com/oauth/authorize?client_id=${apiKey}&redirect_uri=${redirect_uri}&response_type=code`;

const serverURL = process.env.REACT_APP_SERVER_URL;
Expand Down

0 comments on commit 2fb8546

Please sign in to comment.