diff --git a/src/app/api/auth/kakao/route.ts b/src/app/api/auth/kakao/route.ts index e51fa7d8..f07da979 100644 --- a/src/app/api/auth/kakao/route.ts +++ b/src/app/api/auth/kakao/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from "next/server"; export function GET() { - const kakaoAuthUrl = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${process.env.NODE_ENV === "development" ? process.env.NEXT_PUBLIC_KAKAO_REST_API_KEY : process.env.KAKAO_REST_API_KEY}&redirect_uri=${process.env.NODE_ENV === "development" ? process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI : process.env.KAKAO_REDIRECT_URI}`; + const kakaoAuthUrl = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${process.env.NODE_ENV === "development" ? process.env.NEXT_PUBLIC_KAKAO_REST_API_KEY : process.env.KAKAO_REST_API_KEY}&redirect_uri=${process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI}`; return NextResponse.redirect(kakaoAuthUrl); } diff --git a/src/containers/auth/AuthKaKaoContainer.tsx b/src/containers/auth/AuthKaKaoContainer.tsx index 27d0aab4..e2bf16b4 100644 --- a/src/containers/auth/AuthKaKaoContainer.tsx +++ b/src/containers/auth/AuthKaKaoContainer.tsx @@ -17,7 +17,7 @@ const AuthKaKaoContainer = () => { const kakaoLogin = async () => { try { const response = await fetch( - `${process.env.NODE_ENV === "development" ? process.env.NEXT_PUBLIC_BACKEND_URL : process.env.BACKEND_URL}/api/auth/oauth2/login?type=kakao&redirectUrl=${process.env.NODE_ENV === "development" ? process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI : process.env.KAKAO_REDIRECT_URI}&code=${_queryStringObject?.code}`, + `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/auth/oauth2/login?type=kakao&redirectUrl=${process.env.NEXT_PUBLIC_KAKAO_REDIRECT_URI}&code=${_queryStringObject?.code}`, { method: "GET", headers: {