Skip to content
Merged
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export default function RootLayout({
}),
}}
/>
{process.env.NODE_ENV === 'production' && (
<meta
name='google-site-verification'
content='1mgjA-uwRMiKC5wK5856E1uwWcuUl0UTZRuDcpfG214'
/>
)}
Comment on lines +63 to +68
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

구글 사이트 인증 키와 같은 설정 값을 소스 코드에 직접 하드코딩하는 것보다 환경 변수로 관리하는 것이 좋습니다. 이렇게 하면 다음과 같은 이점이 있습니다:

  • 유연성: 개발, 스테이징, 프로덕션 등 다른 환경에서 다른 키를 쉽게 사용할 수 있습니다.
  • 유지보수성: 키를 변경해야 할 때 코드를 수정하고 다시 배포할 필요가 없습니다.
  • 보안: 이 키는 공개적으로 노출되는 값이지만, 다른 민감한 정보가 실수로 코드 저장소에 노출되는 것을 방지하는 좋은 습관을 기를 수 있습니다.

아래와 같이 환경 변수를 사용하도록 변경하는 것을 권장합니다. 제안된 코드에서는 process.env.GOOGLE_SITE_VERIFICATION 환경 변수가 설정되어 있을 때만 메타 태그가 렌더링되도록 하여 안정성을 높였습니다.

Suggested change
{process.env.NODE_ENV === 'production' && (
<meta
name='google-site-verification'
content='1mgjA-uwRMiKC5wK5856E1uwWcuUl0UTZRuDcpfG214'
/>
)}
{process.env.NODE_ENV === 'production' && process.env.GOOGLE_SITE_VERIFICATION && (
<meta
name='google-site-verification'
content={process.env.GOOGLE_SITE_VERIFICATION}
/>
)}

</head>
{/* <Script id='maze-snippet' strategy='lazyOnload'>
{`(function (m, a, z, e) {
Expand Down
Loading