Skip to content

Commit

Permalink
Merge pull request #734 from Kernel360/fix-naver-env
Browse files Browse the repository at this point in the history
Fix naver env
  • Loading branch information
ollehkt authored Apr 10, 2024
2 parents c90ecb3 + d5af76d commit a7e3864
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions frontend/src/app/(without-header)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';

import KakaoBtn from '@/app/_components/ui/button/Kakao';
import LoginLogo from '/public/logo/yigil_logo.svg';
import CloseButton from '@/app/_components/ui/button/CloseButton';
Expand Down Expand Up @@ -28,11 +27,11 @@ export default async function LoginPage({
}: {
searchParams: { status: string };
}) {
const { KAKAO_ID, GOOGLE_CLIENT_ID, NAVER_SEARCH_ID } = process.env;
const { KAKAO_ID, GOOGLE_CLIENT_ID, NAVER_DEVELOPERS_ID } = process.env;

const kakaoHref = await kakaoOAuthEndpoint(KAKAO_ID);
const googleHref = await googleOAuthEndPoint(GOOGLE_CLIENT_ID);
const naverHref = await naverOAuthEndPoint(NAVER_SEARCH_ID);
const naverHref = await naverOAuthEndPoint(NAVER_DEVELOPERS_ID);

return (
<div className="w-full h-full bg-main flex flex-col items-center">
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/_components/search/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export async function searchNaverAction(
const response = await fetch(searchUrl(keyword), {
method: 'GET',
headers: {
'X-Naver-Client-Id': process.env.NAVER_SEARCH_ID,
'X-Naver-Client-Secret': process.env.NAVER_SEARCH_SECRET,
'X-Naver-Client-Id': process.env.NAVER_DEVELOPERS_ID,
'X-Naver-Client-Secret': process.env.NAVER_DEVELOPERS_SECRET,
},
});

Expand All @@ -71,8 +71,8 @@ export async function searchAction(keyword: string): Promise<TSearchResult> {
const response = await fetch(searchUrl(keyword), {
method: 'GET',
headers: {
'X-Naver-Client-Id': process.env.NAVER_SEARCH_ID,
'X-Naver-Client-Secret': process.env.NAVER_SEARCH_SECRET,
'X-Naver-Client-Id': process.env.NAVER_DEVELOPERS_ID,
'X-Naver-Client-Secret': process.env.NAVER_DEVELOPERS_SECRET,
},
});

Expand Down
7 changes: 4 additions & 3 deletions frontend/src/app/endpoints/api/auth/callback/naver/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ export async function GET(request: NextRequest) {
);
}

const { NAVER_SEARCH_ID, NAVER_SEARCH_SECRET, ENVIRONMENT } = process.env;
const { NAVER_DEVELOPERS_ID, NAVER_DEVELOPERS_SECRET, ENVIRONMENT } =
process.env;

const redirectUri = await naverRedirectUri();

const userTokenResponse = await userTokenRequest(
NAVER_SEARCH_ID,
NAVER_DEVELOPERS_ID,
redirectUri,
code,
NAVER_SEARCH_SECRET,
NAVER_DEVELOPERS_SECRET,
);

if (!userTokenResponse.ok) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/types/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ declare global {

NAVER_MAPS_CLIENT_ID: string;
MAP_SECRET: string;
NAVER_SEARCH_ID: string;
NAVER_SEARCH_SECRET: string;
NAVER_DEVELOPERS_ID: string;
NAVER_DEVELOPERS_SECRET: string;

ENVIRONMENT: 'production' | 'development' | 'local';
}
Expand Down

0 comments on commit a7e3864

Please sign in to comment.