Repository: dev-4-team/eye-on-frontend
Pull request #93: [FE] refactor : 위치 검증을 통한 인증 로직을 분리한다
Author: login: pigpgw
Labels: name: refactor
description: Good for newcomers
name: Type
description: This doesn't seem right
Created: 2025-04-18T06:04:59Z | Merged: 2025-04-19T15:06:23Z

## #️⃣연관된 이슈

> #92 

## 📝작업 내용
- 저번 리팩토링때 분리하지 못했던 위치 검증을통한 인증 로직을 훅으로 분리하여 관심사 분리를 진행하였는데 좋은 방법인지 잘 모르겠습니다...
### 스크린샷 (선택)

## 💬리뷰 요구사항(선택)

> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.



Diff:
diff --git a/src/app/(with-hamburger-button)/page.tsx b/src/app/(with-hamburger-button)/page.tsx
index b45d228..255f431 100644
--- a/src/app/(with-hamburger-button)/page.tsx
+++ b/src/app/(with-hamburger-button)/page.tsx
@@ -1,6 +1,6 @@
-import { getProtestList } from '@/api/protest';
-import { KakaoMap } from '@/components/KakaoMaps/KakaoMap';
 import { Metadata } from 'next';
+import KakaoMap from '@/components/KakaoMaps/KakaoMap';
+import { getProtestList } from '@/api/protest';
 
 const keywords = [
   '집회',
diff --git a/src/components/Verification/Verification.tsx b/src/components/Verification/Verification.tsx
index 48e4fcc..82a6caf 100644
--- a/src/components/Verification/Verification.tsx
+++ b/src/components/Verification/Verification.tsx
@@ -1,8 +1,7 @@
 'use client';
 
 import { Loader2 } from 'lucide-react';
-import { useEffect, useState } from 'react';
-import { toast } from 'sonner';
+import { useState } from 'react';
 import { Button } from '@/components/ui/button';
 import { useGeoLocation } from '@/hooks/useGeoLocation';
 import {
@@ -17,7 +16,7 @@ import {
 import ProtestActionButton from '@/components/Button/ProtestActionButton';
 import { getIsMobile, isDesktopOS } from '@/lib/utils';
 import { useUserInfoStore } from '@/store/useUserInfoStore';
-import { getVerificationResponse, getVerifyLocation } from '@/api/verification';
+import { useLocationVerification } from '@/hooks/useLocationVerification';
 
 interface Props {
   paramId: string;
@@ -26,12 +25,14 @@ interface Props {
 export default function Verification({ paramId }: Props) {
   const [agreed, setAgreed] = useState(false);
   const [open, setOpen] = useState(false);
-  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(
-    null,
-  );
   const { curLocation, isLoading, errorMsg } = useGeoLocation(agreed);
   const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
   const isMobile = getIsMobile() && !isDesktopOS();
+  useLocationVerification({
+    agreed,
+    curLocation,
+    protestId: paramId,
+  });
 
   const onVerificationClick = () => {
     if (!isMobile) {
@@ -43,7 +44,6 @@ export default function Verification({ paramId }: Props) {
         `${process.env.NEXT_PUBLIC_LOCAL_DEV_URL}/oauth2/authorization/kakao`,
       );
     else setOpen(true);
-    setOpen(true);
   };
 
   const handleAgree = () => {
@@ -51,82 +51,6 @@ export default function Verification({ paramId }: Props) {
     setOpen(false);
   };
 
-  useEffect(() => {
-    if (!agreed || !curLocation) return;
-
-    const VerifyLocation = async ({
-      paramId,
-      longitude,
-      latitude,
-      accessToken,
-    }: {
-      paramId: string;
-      longitude: number;
-      latitude: number;
-      accessToken: string;
-    }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
-      try {
-        const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });
-
-        if (data.success) {
-          return {
-            success: true,
-            message: data.message,
-          };
-        }
-
-        switch (data.code) {
-          case 'PROTEST_422_1':
-            return {
-              success: false,
-              message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
-              status: data.status,
-              code: data.code,
-            };
-          case 'PROTEST_400_1':
-            return {
-              success: false,
-              message: '존재하지 않는 시위입니다',
-              status: data.status,
-              code: data.code,
-            };
-          case 'PROTEST_409_1':
-            return {
-              success: false,
-              message: '한 개의 시위에 중복 인증은 불가능합니다',
-              status: data.status,
-              code: data.code,
-            };
-          default:
-            return {
-              success: false,
-              message: data.message || '알 수 없는 오류가 발생했습니다',
-              status: data.status,
-              code: data.code,
-            };
-        }
-      } catch (error) {
-        console.error('verify location 에러: ', error);
-        return {
-          success: false,
-          message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
-        };
-      }
-    };
-
-    const verifyUserLocation = async () => {
-      const result = await VerifyLocation({
-        paramId: paramId,
-        longitude: curLocation.longitude,
-        latitude: curLocation.latitude,
-        accessToken: accessToken,
-      });
-      setVerificationResult(result);
-      toast(result.message);
-    };
-    verifyUserLocation();
-  }, [agreed, curLocation]);
-
   if (agreed && errorMsg) {
     return <div>{errorMsg}</div>;
   }
diff --git a/src/hooks/useGeoLocation.tsx b/src/hooks/useGeoLocation.tsx
index 723646a..d00c16d 100644
--- a/src/hooks/useGeoLocation.tsx
+++ b/src/hooks/useGeoLocation.tsx
@@ -1,12 +1,8 @@
 'use client';
 
+import { LocationType } from '@/types/location';
 import { useCallback, useEffect, useState } from 'react';
 
-type LocationType = {
-  latitude: number;
-  longitude: number;
-};
-
 export const useGeoLocation = (permissionStatus: boolean) => {
   const [location, setLocation] = useState<LocationType>();
   const [isLoading, setIsLoading] = useState<boolean>(false);
diff --git a/src/hooks/useLocationVerification.ts b/src/hooks/useLocationVerification.ts
new file mode 100644
index 0000000..d22084d
--- /dev/null
+++ b/src/hooks/useLocationVerification.ts
@@ -0,0 +1,89 @@
+import { useEffect } from 'react';
+import { toast } from 'sonner';
+import { Location } from '@/types/location';
+import { useUserInfoStore } from '@/store/useUserInfoStore';
+import { getVerifyLocation } from '@/api/verification';
+
+interface Props {
+  agreed: boolean;
+  curLocation: Location;
+  protestId: string;
+}
+
+export const useLocationVerification = ({ agreed, curLocation, protestId }: Props) => {
+  const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
+
+  useEffect(() => {
+    if (!agreed || !curLocation || !accessToken || !protestId) return;
+    const verifyUserLocation = async () => {
+      const result = await VerifyLocation({
+        paramId: protestId,
+        longitude: curLocation.longitude,
+        latitude: curLocation.latitude,
+        accessToken: accessToken,
+      });
+      toast(result.message);
+    };
+    verifyUserLocation();
+  }, [agreed, curLocation, accessToken, protestId]);
+
+  const VerifyLocation = async ({
+    paramId,
+    longitude,
+    latitude,
+    accessToken,
+  }: {
+    paramId: string;
+    longitude: number;
+    latitude: number;
+    accessToken: string;
+  }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
+    try {
+      const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });
+
+      if (data.success) {
+        return {
+          success: true,
+          message: data.message,
+        };
+      }
+
+      switch (data.code) {
+        case 'PROTEST_422_1':
+          return {
+            success: false,
+            message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_400_1':
+          return {
+            success: false,
+            message: '존재하지 않는 시위입니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_409_1':
+          return {
+            success: false,
+            message: '한 개의 시위에 중복 인증은 불가능합니다',
+            status: data.status,
+            code: data.code,
+          };
+        default:
+          return {
+            success: false,
+            message: data.message || '알 수 없는 오류가 발생했습니다',
+            status: data.status,
+            code: data.code,
+          };
+      }
+    } catch (error) {
+      console.error('verify location 에러: ', error);
+      return {
+        success: false,
+        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
+      };
+    }
+  };
+};
diff --git a/src/types/location.ts b/src/types/location.ts
new file mode 100644
index 0000000..8fb2331
--- /dev/null
+++ b/src/types/location.ts
@@ -0,0 +1,4 @@
+export type Location = {
+  latitude: number;
+  longitude: number;
+};


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>🔭 Outside diff range comments (1)</summary><blockquote>

<details>
<summary>src/hooks/useGeoLocation.tsx (1)</summary><blockquote>

`3-9`: _⚠️ Potential issue_

**타입 이름 불일치로 인한 컴파일 오류**  

`@/types/location` 에서는 `Location` 을 내보내는데, 이 파일에서는 `LocationType` 을 import / 사용하고 있습니다.  
아래와 같이 수정하지 않으면 타입을 찾을 수 없어 빌드가 실패합니다.

```diff
-import { LocationType } from '@/types/location';
+import { Location } from '@/types/location';

-  const [location, setLocation] = useState<LocationType>();
+  const [location, setLocation] = useState<Location>();
```
또한 다른 파일에서 `LocationType` 을 참조하고 있다면 동일하게 정정해 주세요.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (8)</summary><blockquote>

<details>
<summary>src/types/location.ts (1)</summary><blockquote>

`1-4`: **`Location` 타입이 브라우저 전역 `Location` 인터페이스와 혼동될 수 있습니다**  

DOM 환경에서 `window.location` 의 타입이 `Location`으로 이미 정의되어 있어, IDE 자동완성·import 경로 등에서 혼란이 발생할 수 있습니다.  
의미 구분을 명확히 하고 잠재적인 네이밍 충돌을 피하기 위해 보다 구체적인 이름(예: `GeoLocation`, `LatLng`)으로 변경하는 것을 권장드립니다.

```diff
-export type Location = {
+export type GeoLocation = {
   latitude: number;
   longitude: number;
 };
```
변경 후, 이 타입을 import 하는 모든 곳도 함께 수정해 주세요.

</blockquote></details>
<details>
<summary>src/components/Verification/Verification.tsx (2)</summary><blockquote>

`38-41`: **모바일 검사 로직 주석 처리로 `isMobile` 변수가 미사용 상태**  

`isMobile` 이 더 이상 필요 없다면 변수 선언을 제거하고, 인증 제한 로직이 필요하다면 주석을 해제하여 실제로 동작하게 해 주세요.

---

`42-48`: **`setOpen(true)` 중복 호출**  

`else` 분기에서 이미 `setOpen(true)`를 호출하므로 마지막 줄은 제거해도 됩니다.

```diff
-  else setOpen(true);
-  setOpen(true);
+  else setOpen(true);
```

</blockquote></details>
<details>
<summary>src/hooks/useVerificationNumber.ts (5)</summary><blockquote>

`29-77`: **함수 명명 규칙을 준수하세요.**

`VerifyLocation` 함수는 파스칼 케이스(PascalCase)로 작성되어 있는데, 자바스크립트/타입스크립트에서 함수는 카멜 케이스(camelCase)를 사용하는 것이 일반적인 컨벤션입니다.

```diff
-  const VerifyLocation = async ({
+  const verifyLocation = async ({
```

또한 해당 함수의 반환 타입은 이미 가져온 `getVerificationResponse` 타입과 동일하므로 이를 활용하는 것이 좋습니다.
```diff
-  }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
+  }): Promise<getVerificationResponse> => {
```

---

`79-79`: **curLocation 유효성 검사 방식 개선이 필요합니다.**

`!curLocation`은 `curLocation`이 `null` 또는 `undefined`일 때만 `true`입니다. `curLocation`이 빈 객체일 경우 이 검사를 통과할 수 있습니다. 더 엄격한 검사를 고려해보세요.

```diff
-    if (!agreed || !curLocation) return;
+    if (!agreed || !curLocation || typeof curLocation.latitude !== 'number' || typeof curLocation.longitude !== 'number') return;
```

---

`80-86`: **매개변수 전달 방식을 단순화할 수 있습니다.**

`verifyUserLocation` 함수 내에서 객체를 생성하여 `VerifyLocation`에 전달하는 대신, 부모 스코프에서 사용 가능한 변수들을 직접 사용할 수 있습니다.

```diff
    const verifyUserLocation = async () => {
-      const result = await VerifyLocation({
-        paramId: protestId,
-        longitude: curLocation.longitude,
-        latitude: curLocation.latitude,
-        accessToken: accessToken,
-      });
+      const result = await verifyLocation({
+        paramId: protestId,
+        longitude: curLocation.longitude,
+        latitude: curLocation.latitude,
+        accessToken,
+      });
```

---

`70-76`: **에러 로깅을 더 구체적으로 개선하세요.**

현재 에러 로깅은 단순히 'verify location 에러: '와 에러 객체를 출력합니다. 에러를 더 구체적으로 추적할 수 있도록 추가 정보를 포함하는 것이 좋습니다.

```diff
    } catch (error) {
-      console.error('verify location 에러: ', error);
+      console.error(`verify location 에러 (protestId: ${paramId}): `, error);
      return {
        success: false,
        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
      };
```

---

`40-69`: **에러 코드를 상수로 관리하는 것을 고려하세요.**

에러 코드와 메시지가 하드코딩되어 있습니다. 프로젝트가 확장되면서 다국어 지원이나 코드 재사용을 위해 상수 파일로 분리하는 것이 좋습니다.

좀 더 유지보수하기 쉬운 방식으로 에러 케이스를 관리하는 예시입니다:

```typescript
// src/constants/errorMessages.ts
export const ERROR_CODES = {
  PROTEST_422_1: {
    message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
  },
  PROTEST_400_1: {
    message: '존재하지 않는 시위입니다',
  },
  PROTEST_409_1: {
    message: '한 개의 시위에 중복 인증은 불가능합니다',
  },
};

export const DEFAULT_ERROR_MESSAGE = '알 수 없는 오류가 발생했습니다';
export const SERVER_CONNECTION_ERROR = '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.';
```

그리고 훅에서는 다음과 같이 사용할 수 있습니다:

```typescript
import { ERROR_CODES, DEFAULT_ERROR_MESSAGE, SERVER_CONNECTION_ERROR } from '@/constants/errorMessages';

// ...
switch (data.code) {
  case 'PROTEST_422_1':
  case 'PROTEST_400_1':
  case 'PROTEST_409_1':
    return {
      success: false,
      message: ERROR_CODES[data.code].message,
      status: data.status,
      code: data.code,
    };
  default:
    return {
      success: false,
      message: data.message || DEFAULT_ERROR_MESSAGE,
      status: data.status,
      code: data.code,
    };
}
// ...catch 블록
return {
  success: false,
  message: SERVER_CONNECTION_ERROR,
};
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between fd4b5e5c4dca0ea2d5da1a85f0f2d54be4e85e77 and 69c2860838f2b3e54d682eebd7ad3f241bcaa8e3.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `src/app/(with-hamburger-button)/page.tsx` (1 hunks)
* `src/components/Verification/Verification.tsx` (3 hunks)
* `src/hooks/useGeoLocation.tsx` (1 hunks)
* `src/hooks/useVerificationNumber.ts` (1 hunks)
* `src/types/location.ts` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (2)</summary>

<details>
<summary>src/components/Verification/Verification.tsx (1)</summary><blockquote>

<details>
<summary>src/hooks/useVerificationNumber.ts (1)</summary>

* `useLocationVerification` (13-93)

</details>

</blockquote></details>
<details>
<summary>src/hooks/useVerificationNumber.ts (3)</summary><blockquote>

<details>
<summary>src/types/location.ts (1)</summary>

* `Location` (1-4)

</details>
<details>
<summary>src/api/verification.ts (2)</summary>

* `getVerificationResponse` (23-28)
* `getVerifyLocation` (30-51)

</details>
<details>
<summary>src/store/useUserInfoStore.ts (1)</summary>

* `useUserInfoStore` (19-35)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>src/app/(with-hamburger-button)/page.tsx (1)</summary>

`2-3`: <details>
<summary>✅ Verification successful</summary>

**`KakaoMap`이 실제로 default export인지 확인이 필요합니다**  

기존에 named export였다면 컴파일 오류가 발생합니다.  
다음 스크립트로 정의부를 점검해 주세요.

---

🏁 Script executed:

```shell
#!/bin/bash
# KakaoMap 의 export 형태 확인
rg -A2 -n $'export default function KakaoMap' | head
```

Length of output: 53

---

KakaoMap 컴포넌트의 export 형태를 정확히 확인하기 위해 파일 경로 및 export 문을 추가로 검색합니다:

---

🏁 Script executed:

```shell
#!/bin/bash
# 1. KakaoMap 컴포넌트가 정의된 파일 경로 확인
echo "=== KakaoMap 정의 파일 목록 ==="
fd KakaoMap

# 2. 해당 파일들의 export 구문 확인
echo "=== export 구문 검색 결과 ==="
rg -n 'export ' -g '*KakaoMap*.*'
```

Length of output: 420

---



</details>

**문제 없음: KakaoMap은 default export입니다**  
KakaoMap 컴포넌트가 `src/components/KakaoMaps/KakaoMap.tsx`에서 `export default KakaoMap;`로 정의되어 있어,  
`import KakaoMap from '@/components/KakaoMaps/KakaoMap';` 구문이 올바르게 동작합니다.

</details>
<details>
<summary>src/hooks/useVerificationNumber.ts (1)</summary>

`1-93`: **훅 추출 및 관심사 분리가 잘 되었습니다.**

위치 기반 인증 로직을 커스텀 훅으로 분리하여 재사용성과 가독성을 높인 좋은 리팩토링입니다. 코드가 깔끔하고 목적에 맞게 잘 구현되었습니다.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: CHANGES_REQUESTED
author_association: NONE
submitted_at: 2025-04-18T06:07:58Z
user: login: pigpgw
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-18T07:48:27Z
user: login: coderabbitai[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-18T07:49:59Z
user: login: giujae
body: 음 짤때는 생각을 못했는데 사실 Verification.tsx 파일 자체가 ui를 렌더하는 부분이 없어서 컴포넌트 보다는 아예 다 훅으로 빼는 게 맞지 않았나 싶은 느낌이 있어서 한 번 고려해 주시면 좋겠습니다~
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-19T05:09:23Z

Review comments:
diff_hunk: @@ -26,18 +25,20 @@ interface Props {
 export default function Verification({ paramId }: Props) {
   const [agreed, setAgreed] = useState(false);
   const [open, setOpen] = useState(false);
-  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(
-    null,
-  );
   const { curLocation, isLoading, errorMsg } = useGeoLocation(agreed);
   const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
   const isMobile = getIsMobile() && !isDesktopOS();
+  const verificationResult = useLocationVerification({
+    agreed,
+    curLocation,
+    protestId: paramId,
+  });
path: src/components/Verification/Verification.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**`verificationResult`가 사용되지 않아 ESLint 경고가 발생합니다**  

훅은 부수효과(toast)만 사용하고 결과를 무시한다면 변수명을 `_` 로 바꾸거나 `eslint-disable-next-line no-unused-vars` 주석을 추가해 주세요.

```diff
-  const verificationResult = useLocationVerification({
+  // 결과 값은 훅 내부 부수효과(토스트)만 사용합니다.
+  // eslint-disable-next-line no-unused-vars
+  const _verificationResult = useLocationVerification({
     agreed,
     curLocation,
     protestId: paramId,
   });
```



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
  // 결과 값은 훅 내부 부수효과(토스트)만 사용합니다.
  // eslint-disable-next-line no-unused-vars
  const _verificationResult = useLocationVerification({
    agreed,
    curLocation,
    protestId: paramId,
  });
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-18T06:07:57Z
author_association: NONE
diff_hunk: @@ -0,0 +1,93 @@
+import { useEffect, useState } from 'react';
+import { toast } from 'sonner';
+import { Location } from '@/types/location';
+import { useUserInfoStore } from '@/store/useUserInfoStore';
+import { getVerificationResponse, getVerifyLocation } from '@/api/verification';
+
+interface Props {
+  agreed: boolean;
+  curLocation: Location;
+  protestId: string;
+}
+
+export const useLocationVerification = ({ agreed, curLocation, protestId }: Props) => {
+  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(
+    null,
+  );
+  const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
+
+  const VerifyLocation = async ({
+    paramId,
+    longitude,
+    latitude,
+    accessToken,
+  }: {
+    paramId: string;
+    longitude: number;
+    latitude: number;
+    accessToken: string;
+  }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
+    try {
+      const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });
+
+      if (data.success) {
+        return {
+          success: true,
+          message: data.message,
+        };
+      }
+
+      switch (data.code) {
+        case 'PROTEST_422_1':
+          return {
+            success: false,
+            message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_400_1':
+          return {
+            success: false,
+            message: '존재하지 않는 시위입니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_409_1':
+          return {
+            success: false,
+            message: '한 개의 시위에 중복 인증은 불가능합니다',
+            status: data.status,
+            code: data.code,
+          };
+        default:
+          return {
+            success: false,
+            message: data.message || '알 수 없는 오류가 발생했습니다',
+            status: data.status,
+            code: data.code,
+          };
+      }
+    } catch (error) {
+      console.error('verify location 에러: ', error);
+      return {
+        success: false,
+        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
+      };
+    }
+  };
+  useEffect(() => {
+    if (!agreed || !curLocation) return;
+    const verifyUserLocation = async () => {
+      const result = await VerifyLocation({
+        paramId: protestId,
+        longitude: curLocation.longitude,
+        latitude: curLocation.latitude,
+        accessToken: accessToken,
+      });
+      setVerificationResult(result);
+      toast(result.message);
+    };
+    verifyUserLocation();
+  }, [agreed, curLocation]);
path: src/hooks/useVerificationNumber.ts
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**useEffect의 의존성 배열이 불완전합니다.**

useEffect 내부에서 `protestId`와 `accessToken`을 사용하고 있지만 의존성 배열에는 포함되어 있지 않습니다. 이로 인해 이 값들이 변경될 때 효과가 다시 실행되지 않을 수 있습니다.

```diff
-  }, [agreed, curLocation]);
+  }, [agreed, curLocation, protestId, accessToken]);
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
  useEffect(() => {
    if (!agreed || !curLocation) return;
    const verifyUserLocation = async () => {
      const result = await VerifyLocation({
        paramId: protestId,
        longitude: curLocation.longitude,
        latitude: curLocation.latitude,
        accessToken: accessToken,
      });
      setVerificationResult(result);
      toast(result.message);
    };
    verifyUserLocation();
  }, [agreed, curLocation, protestId, accessToken]);
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated reply by CodeRabbit -->
created_at: 2025-04-18T06:07:57Z
author_association: NONE
diff_hunk: @@ -0,0 +1,93 @@
+import { useEffect, useState } from 'react';
+import { toast } from 'sonner';
+import { Location } from '@/types/location';
+import { useUserInfoStore } from '@/store/useUserInfoStore';
+import { getVerificationResponse, getVerifyLocation } from '@/api/verification';
+
+interface Props {
+  agreed: boolean;
+  curLocation: Location;
+  protestId: string;
+}
+
+export const useLocationVerification = ({ agreed, curLocation, protestId }: Props) => {
+  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(
+    null,
+  );
+  const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
+
+  const VerifyLocation = async ({
+    paramId,
+    longitude,
+    latitude,
+    accessToken,
+  }: {
+    paramId: string;
+    longitude: number;
+    latitude: number;
+    accessToken: string;
+  }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
+    try {
+      const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });
+
+      if (data.success) {
+        return {
+          success: true,
+          message: data.message,
+        };
+      }
+
+      switch (data.code) {
+        case 'PROTEST_422_1':
+          return {
+            success: false,
+            message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_400_1':
+          return {
+            success: false,
+            message: '존재하지 않는 시위입니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_409_1':
+          return {
+            success: false,
+            message: '한 개의 시위에 중복 인증은 불가능합니다',
+            status: data.status,
+            code: data.code,
+          };
+        default:
+          return {
+            success: false,
+            message: data.message || '알 수 없는 오류가 발생했습니다',
+            status: data.status,
+            code: data.code,
+          };
+      }
+    } catch (error) {
+      console.error('verify location 에러: ', error);
+      return {
+        success: false,
+        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
+      };
+    }
+  };
+  useEffect(() => {
+    if (!agreed || !curLocation) return;
+    const verifyUserLocation = async () => {
+      const result = await VerifyLocation({
+        paramId: protestId,
+        longitude: curLocation.longitude,
+        latitude: curLocation.latitude,
+        accessToken: accessToken,
+      });
+      setVerificationResult(result);
+      toast(result.message);
+    };
+    verifyUserLocation();
+  }, [agreed, curLocation]);
path: src/hooks/useVerificationNumber.ts
user: login: pigpgw
body: @coderabbitai full review
created_at: 2025-04-18T07:48:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,93 @@
+import { useEffect, useState } from 'react';
+import { toast } from 'sonner';
+import { Location } from '@/types/location';
+import { useUserInfoStore } from '@/store/useUserInfoStore';
+import { getVerificationResponse, getVerifyLocation } from '@/api/verification';
+
+interface Props {
+  agreed: boolean;
+  curLocation: Location;
+  protestId: string;
+}
+
+export const useLocationVerification = ({ agreed, curLocation, protestId }: Props) => {
+  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(
+    null,
+  );
+  const accessToken = useUserInfoStore(state => state.userInfo.accessToken);
+
+  const VerifyLocation = async ({
+    paramId,
+    longitude,
+    latitude,
+    accessToken,
+  }: {
+    paramId: string;
+    longitude: number;
+    latitude: number;
+    accessToken: string;
+  }): Promise<{ success: boolean; message: string; status?: number; code?: string }> => {
+    try {
+      const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });
+
+      if (data.success) {
+        return {
+          success: true,
+          message: data.message,
+        };
+      }
+
+      switch (data.code) {
+        case 'PROTEST_422_1':
+          return {
+            success: false,
+            message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_400_1':
+          return {
+            success: false,
+            message: '존재하지 않는 시위입니다',
+            status: data.status,
+            code: data.code,
+          };
+        case 'PROTEST_409_1':
+          return {
+            success: false,
+            message: '한 개의 시위에 중복 인증은 불가능합니다',
+            status: data.status,
+            code: data.code,
+          };
+        default:
+          return {
+            success: false,
+            message: data.message || '알 수 없는 오류가 발생했습니다',
+            status: data.status,
+            code: data.code,
+          };
+      }
+    } catch (error) {
+      console.error('verify location 에러: ', error);
+      return {
+        success: false,
+        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
+      };
+    }
+  };
+  useEffect(() => {
+    if (!agreed || !curLocation) return;
+    const verifyUserLocation = async () => {
+      const result = await VerifyLocation({
+        paramId: protestId,
+        longitude: curLocation.longitude,
+        latitude: curLocation.latitude,
+        accessToken: accessToken,
+      });
+      setVerificationResult(result);
+      toast(result.message);
+    };
+    verifyUserLocation();
+  }, [agreed, curLocation]);
path: src/hooks/useVerificationNumber.ts
user: login: coderabbitai[bot]
body: <details>
<summary>🧩 Analysis chain</summary>

I need to perform a full review of this PR that refactors authentication logic by extracting location verification into a custom hook. Let me gather more information about the changes first.

---

🏁 Script executed:
```
#!/bin/bash
# Get the content of the main files modified in this PR
echo "=== src/components/Verification/Verification.tsx ==="
cat src/components/Verification/Verification.tsx

echo -e "\n\n=== src/hooks/useVerificationNumber.ts ==="
cat src/hooks/useVerificationNumber.ts

echo -e "\n\n=== src/types/location.ts ==="
cat src/types/location.ts

echo -e "\n\n=== src/hooks/useGeoLocation.tsx ==="
cat src/hooks/useGeoLocation.tsx

echo -e "\n\n=== Checking API reference for getVerifyLocation ==="
rg -p "getVerifyLocation" src/api/
```

Length of output: 7936

---

🏁 Script executed:
```
#!/bin/bash
# Check the verification API implementation
cat src/api/verification.ts

# Check how the verification result was handled in the previous implementation
git show HEAD^:src/components/Verification/Verification.tsx
```

Length of output: 1305

---

🏁 Script executed:
```
#!/bin/bash
# Try a different approach to see the git history
git log -n 3 --oneline

# Check if we can see the previous file in a different way
git show HEAD:src/components/Verification/Verification.tsx

# Also check if we can list the commit details to understand the changes better
git show --name-status HEAD
```

Length of output: 6400

---



</details>

@pigpgw 이 PR에 대한 전체 리뷰를 진행하겠습니다.

## 긍정적인 측면

- 인증 로직을 커스텀 훅으로 분리하여 관심사 분리를 잘 적용하셨습니다.
- 컴포넌트에서 로직을 분리함으로써 유지보수성과 가독성이 향상되었습니다.
- `Location` 타입을 별도 파일로 분리하여 타입 관리가 개선되었습니다.
- 이전에 지적된 `useEffect` 의존성 배열 문제가 수정되었습니다.

## 개선이 필요한 부분

1. **함수 정의 순서 문제**:
   `useVerificationNumber.ts` 파일에서 `VerifyLocation` 함수가 `useEffect` 내에서 사용되기 전에 정의되어야 합니다.

2. **상태 관리 및 반환 값 문제**:
   훅에서 `verificationResult` 상태를 생성하지만 이를 반환하지 않아 컴포넌트에서 사용할 수 없습니다.

3. **파일명과 함수명 불일치**:
   `useVerificationNumber.ts` 파일이 `useLocationVerification` 훅을 내보냅니다. 일관성 있는 네이밍이 필요합니다.

4. **함수 메모이제이션 필요**:
   `VerifyLocation` 함수는 렌더링마다 재생성됩니다. `useCallback`을 사용하여 최적화할 수 있습니다.

## 코드 개선 제안

```typescript
// src/hooks/useVerificationNumber.ts 또는 useLocationVerification.ts로 변경
import { useCallback, useEffect, useState } from 'react';
import { toast } from 'sonner';
import { Location } from '@/types/location';
import { useUserInfoStore } from '@/store/useUserInfoStore';
import { getVerificationResponse, getVerifyLocation } from '@/api/verification';

interface Props {
  agreed: boolean;
  curLocation: Location;
  protestId: string;
}

export const useLocationVerification = ({ agreed, curLocation, protestId }: Props) => {
  const [verificationResult, setVerificationResult] = useState<getVerificationResponse | null>(null);
  const accessToken = useUserInfoStore(state => state.userInfo.accessToken);

  const VerifyLocation = useCallback(async ({
    paramId,
    longitude,
    latitude,
    accessToken,
  }: {
    paramId: string;
    longitude: number;
    latitude: number;
    accessToken: string;
  }): Promise<getVerificationResponse> => {
    try {
      const data = await getVerifyLocation({ paramId, longitude, latitude, accessToken });

      if (data.success) {
        return {
          success: true,
          message: data.message,
        };
      }

      switch (data.code) {
        case 'PROTEST_422_1':
          return {
            success: false,
            message: '현재 위치가 시위 참여 가능 범위를 벗어났습니다',
            status: data.status,
            code: data.code,
          };
        case 'PROTEST_400_1':
          return {
            success: false,
            message: '존재하지 않는 시위입니다',
            status: data.status,
            code: data.code,
          };
        case 'PROTEST_409_1':
          return {
            success: false,
            message: '한 개의 시위에 중복 인증은 불가능합니다',
            status: data.status,
            code: data.code,
          };
        default:
          return {
            success: false,
            message: data.message || '알 수 없는 오류가 발생했습니다',
            status: data.status,
            code: data.code,
          };
      }
    } catch (error) {
      console.error('verify location 에러: ', error);
      return {
        success: false,
        message: '서버 연결에 실패했습니다. 잠시 후 다시 시도해주세요.',
      };
    }
  }, []);

  useEffect(() => {
    if (!agreed || !curLocation) return;
    const verifyUserLocation = async () => {
      const result = await VerifyLocation({
        paramId: protestId,
        longitude: curLocation.longitude,
        latitude: curLocation.latitude,
        accessToken: accessToken,
      });
      setVerificationResult(result);
      toast(result.message);
    };
    verifyUserLocation();
  }, [agreed, curLocation, accessToken, protestId, VerifyLocation]);

  return verificationResult;
};
```

이 개선안은 다음과 같은 변경사항을 포함합니다:
1. `VerifyLocation` 함수를 `useEffect` 앞에 정의
2. `useCallback`을 사용하여 함수 메모이제이션
3. 훅에서 `verificationResult` 상태를 반환하도록 수정
4. `useEffect` 의존성 배열에 `VerifyLocation` 추가

이러한 개선으로 코드의 품질과 사용성이 더욱 향상될 것입니다.

(^‿^) 🐰

<!-- This is an auto-generated reply by CodeRabbit -->
created_at: 2025-04-18T07:49:59Z
author_association: NONE

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-04-18T06:05:05Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: skip review by coderabbit.ai -->

> [!IMPORTANT]
> ## Review skipped
> 
> Auto reviews are disabled on base/target branches other than the default branch.
> 
> 
> 
> Please check the settings in the CodeRabbit UI or the `.coderabbit.yaml` file in this repository. To trigger a single review, invoke the `@coderabbitai review` command.
> 
> You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file.

<!-- end of auto-generated comment: skip review by coderabbit.ai -->
<!-- walkthrough_start -->

## Summary by CodeRabbit

- **신규 기능**
  - 위치 기반 인증을 위한 커스텀 훅이 추가되어, 사용자가 위치 인증을 보다 간편하게 진행할 수 있습니다.

- **버그 수정**
  - 위치 타입 정의가 통합되어 위치 정보 처리의 일관성이 향상되었습니다.

- **리팩터링**
  - 위치 인증 관련 로직이 커스텀 훅으로 분리되어 코드 구조가 개선되었습니다.
## Walkthrough

이번 변경에서는 위치 기반 인증 로직을 커스텀 훅(`useLocationVerification`)으로 분리하여 재사용성과 가독성을 높였습니다. 기존의 `Verification` 컴포넌트 내부에서 직접 처리하던 위치 인증 및 토스트 메시지 로직이 새 훅으로 이동하였고, 타입 정의(`Location`)도 별도의 타입 파일로 분리되었습니다. 일부 import 문 정리와 코드 리팩터링도 함께 이루어졌으며, 전체적인 컴포넌트의 외부 인터페이스는 변경되지 않았습니다.

## Changes

| 파일(들) | 변경 요약 |
|---|---|
| src/components/Verification/Verification.tsx | 위치 인증 관련 `useEffect` 및 상태 관리 로직 삭제, `useLocationVerification` 훅 사용으로 대체, 관련 import 정리 및 주석 처리 |
| src/hooks/useVerificationNumber.ts | 위치 인증 전용 커스텀 훅 `useLocationVerification` 신규 구현, API 호출·에러 처리·토스트 메시지 등 인증 흐름 내장 |
| src/types/location.ts | 위치 정보를 위한 타입 `Location` 신규 정의: `{ latitude: number; longitude: number }` |
| src/hooks/useGeoLocation.tsx | 기존 파일 내 `LocationType` 정의 삭제, 타입을 외부(`@/types/location`)에서 import 하도록 변경 |
| src/app/(with-hamburger-button)/page.tsx | import 순서 및 방식 정리(`KakaoMap`을 기본 import로, 순서 변경) |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant VerificationComponent
    participant useLocationVerification
    participant getVerifyLocationAPI
    participant Toast

    VerificationComponent->>useLocationVerification: agreed, curLocation, protestId 전달
    useLocationVerification->>useLocationVerification: agreed && curLocation 변경시 useEffect 실행
    useLocationVerification->>getVerifyLocationAPI: getVerifyLocation 호출 (protestId, 위치, 토큰)
    getVerifyLocationAPI-->>useLocationVerification: 인증 결과/에러 반환
    useLocationVerification->>Toast: 결과 메시지 표시
    useLocationVerification-->>VerificationComponent: verificationResult 반환
```

## Suggested labels

`refactor`

## Poem

> 🐰  
> 리팩터링 바람이 불어왔네,  
> 인증 로직 훅 속에 쏙—  
> 위치 타입도 새 둥지 찾아  
> 토스트와 메시지, 깔끔하게 분리!  
> 토끼는 오늘도 깡총깡총,  
> 더 깨끗해진 코드를 꿈꾸며  
> 🗺️✨  
>

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACJ/ADM0MXwKAHozAE4AJkguQBBxwA05yEAAmsBcycARcchAVsXAHV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e6769AsC/MtiVWmwpGCoAwAA3ugHnnzM1LJiQJgARKXlOlwFOgRN1vZlwPdmWAAL4vAAC8egRm1CaBYW0gSWkAAAPvCN4F4FklgOjJqtqrqiCKwWKNBpdLBjuOjL3OeuXMBnWgfA2igZ3DuPBj9IhlauVChnauhiSlhjhtCIoQsLiB2DmioQXhRooJ7FEHiPyIIQofWikJZqoYgIWvstAm6IGu6vcOQA1nVCIGIO7J7DKj5K3qbDwWwLcDnAqucqevzNKOECNnMsAoDsNkoFApAAAEKtpCYHzKynrW7ETXhRChIjggiGbGZ/wHTmY+xWgUAHjSrKLLqIb/7rrv6pjIrbqJygH7puyfqQH4r5xno5QwDeEaIvj8zl6i6xEFE1joxYGJHpEkBcAIiSEUAADcp8Q2E2KxkRSImxkANB/BwCmqxhyhHcXcMh5qZcG03UeKRUQYg0Q8KGtyk0aA00/4Y880SOS08kHUa0hg9xQU6g5OTmiA5O+kzMtA5OSSysgJm0UAAAbOkAwJkAABxIls7okojolxCZACAogkAACslOtASJ6JmQG4AgtAAA7BoiiPiZTnTgIGsGgOiSQCiAiQYMCd+KCeCZCTZOeHQOToVICUAA -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=dev-4-team/eye-on-frontend&utm_content=93):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: pigpgw
created_at: 2025-04-18T06:05:49Z
body: @coderabbitai review
author_association: CONTRIBUTOR
user: login: coderabbitai[bot]
created_at: 2025-04-18T06:05:55Z
body: <!-- This is an auto-generated reply by CodeRabbit -->
<details>
<summary>:white_check_mark: Actions performed</summary>

Review triggered.

> Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

</details>
author_association: NONE