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

Fix naver env #734

Merged
merged 19 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
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
Loading