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
11 changes: 7 additions & 4 deletions src/pages/main/node/[placeId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import { useUserStatus } from '@/shared/hooks/useUserStatus';
import { useStampAcquire } from '@/shared/api/main/node/queries/useStampAcquire';
import { savePostcard } from '@/shared/utils/storage';
import { Skeleton } from '@/shared/components/skeleton/Skeleton';
import { useQueryClient } from '@tanstack/react-query';

const Node = () => {
const router = useRouter();
const { placeId } = router.query;
const [showLoginPopup, setShowLoginPopup] = useState(false);
const [showErrorPopup, setShowErrorPopup] = useState(false);
const { isLoggedIn } = useUserStatus();
const queryClient = useQueryClient();

// 이미지 λ‘œλ”© μƒνƒœ
const [imageLoaded, setImageLoaded] = useState(false);
Expand Down Expand Up @@ -67,6 +69,7 @@ const Node = () => {
const { isCompleted, imageUrl, placeName, description, address } = data.data;

// πŸ”Ή μŠ€νƒ¬ν”„ 찍기 λ²„νŠΌ

const handleStampClick = () => {
if (!isLoggedIn) {
setShowLoginPopup(true);
Expand All @@ -78,11 +81,8 @@ const Node = () => {
getLocation(
(pos) => {
const body = {
latitude: 37.52146604044732,
latitude: 37.52146604044732,
longitude: 126.76740151260397,
// μ‹€μ œ μœ„μΉ˜ μ‚¬μš© μ‹œ:
// latitude: pos.coords.latitude,
// longitude: pos.coords.longitude,
};
Comment on lines 81 to 86

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | πŸ”΄ Critical

ν•˜λ“œμ½”λ”©λœ μ’Œν‘œλ‘œ 인해 μœ„μΉ˜ 기반 검증이 μš°νšŒλ©λ‹ˆλ‹€.

getLocation()을 ν˜ΈμΆœν•˜μ—¬ μ‚¬μš©μžμ˜ μ‹€μ œ μœ„μΉ˜λ₯Ό λ°›μ•„μ˜€μ§€λ§Œ, 받은 pos νŒŒλΌλ―Έν„°λ₯Ό μ‚¬μš©ν•˜μ§€ μ•Šκ³  ν•˜λ“œμ½”λ”©λœ μ’Œν‘œλ₯Ό μ „μ†‘ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. 이둜 인해:

  • μœ„μΉ˜ 기반 μŠ€νƒ¬ν”„ νšλ“ 검증이 μ™„μ „νžˆ 무λ ₯ν™”λ©λ‹ˆλ‹€
  • μ‚¬μš©μžμ—κ²Œ λΆˆν•„μš”ν•˜κ²Œ μœ„μΉ˜ κΆŒν•œμ„ μš”μ²­ν•©λ‹ˆλ‹€
  • ν…ŒμŠ€νŠΈ/디버그 μ½”λ“œκ°€ ν”„λ‘œλ•μ…˜μ— 머지될 μœ„ν—˜μ΄ μžˆμŠ΅λ‹ˆλ‹€

이것이 μ˜λ„λœ ν…ŒμŠ€νŠΈ μ½”λ“œμΈμ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€. ν”„λ‘œλ•μ…˜μ— 배포할 경우, μ‹€μ œ μ‚¬μš©μž μœ„μΉ˜λ₯Ό μ‚¬μš©ν•˜λ„λ‘ μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€:

 const body = {
-  latitude: 37.52146604044732,
-  longitude: 126.76740151260397,
+  latitude: pos.coords.latitude,
+  longitude: pos.coords.longitude,
 };

λ˜λŠ” ν…ŒμŠ€νŠΈ λͺ©μ μ΄λΌλ©΄, λ³„λ„μ˜ feature flagλ‚˜ ν™˜κ²½ λ³€μˆ˜λ‘œ λΆ„λ¦¬ν•˜λŠ” 것을 ꢌμž₯ν•©λ‹ˆλ‹€.

πŸ€– Prompt for AI Agents
In src/pages/main/node/[placeId].tsx around lines 81 to 86, the callback to
getLocation ignores the received pos and sends hardcoded coordinates which
bypasses location-based validation; replace the hardcoded latitude/longitude
with the actual pos values (e.g., pos.coords.latitude and pos.coords.longitude)
so the app uses the user’s real location, and if those literal coordinates were
left for testing wrap the behavior behind a feature flag or environment variable
(or remove before prod); confirm intent and ensure location-permission flow and
error handling remain correct when using pos.

const placeIdNum = Number(placeId);

Expand All @@ -91,6 +91,9 @@ const Node = () => {
{
onSuccess: (res) => {
const { postcard } = res.data;

queryClient.invalidateQueries({ queryKey: ['stampStatus'] });

savePostcard(postcard);

router.push({
Expand Down
Loading