Skip to content

Commit

Permalink
hotfix: 도메인 추가 (#37)
Browse files Browse the repository at this point in the history
* fix: 카카오로그인 도메인 status 추가

* fix: 워크플로우 BASE_URL 추가
  • Loading branch information
a-honey authored Mar 1, 2024
1 parent 649d229 commit eaa6692
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
# 환경 변수 추가
- name: Set Environment Variables
run: |
echo "NEXT_PUBLIC_BASE_URI=${{ secrets.NEXT_PUBLIC_BASE_URI }}" >> .env
echo "NEXT_PUBLIC_KAKAO_API_KEY=${{ secrets.NEXT_PUBLIC_KAKAO_API_KEY }}" >> .env
echo "NEXT_PUBLIC_KAKAO_REDIRECT_URI=${{ secrets.NEXT_PUBLIC_KAKAO_REDIRECT_URI }}" >> .env
echo "NEXT_PUBLIC_GOOGLE_API_KEY=${{ secrets.NEXT_PUBLIC_GOOGLE_API_KEY }}" >> .env
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/queries/login/useGetKakaoToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { useRouter } from 'next/router';

const useGetKakaoToken = (code: string | null = '') => {
const router = useRouter();
const status = window.location.href.split('//')[1].split('/')[0] === 'localhost:3000' ? 'dev' : 'prod';
const { data } = useBaseQuery<{
accessToken: string;
refreshToken: string;
kakaoId: number;
kakaoEmail: string;
}>(queryKeys.KAKAO(), `/users/kakao-login?code=${code}`, true);
}>(queryKeys.KAKAO(), `/users/kakao-login?code=${code}&status=${status}`, true);

if (data?.data?.accessToken === undefined) {
void router.push(`/mypage/profile?kakaoId=${data?.data?.kakaoId}&kakaoEmail=${data?.data?.kakaoEmail}`);
Expand Down

0 comments on commit eaa6692

Please sign in to comment.