Skip to content

feat: 로그인 후 리다이렉트 대상을 대시보드로 변경 - #79

Merged
yoohyun-1203 merged 2 commits into
devfrom
feature/32-schedule-ui
Jun 14, 2026
Merged

yoohyun-1203 merged 2 commits into
devfrom
feature/32-schedule-ui

Conversation

@yoohyun-1203

@yoohyun-1203 yoohyun-1203 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

🚀 작업 내용 (What)

로그인햇을 때 메인화면 보이게

📣 핵심 변경 이유 (Why)

냅다 모임만들기 뜨니까 당황스러부요

📸 스크린샷 (Visuals, 선택)

⚠️ 체크리스트 (Checklist)

  • 브랜치 컨벤션(feature/00-name)을 지켰나요?
  • 커밋 컨벤션(feat:, fix: 등)을 지켰나요?
  • 작업 전에 관련 이슈를 생성하고 연결했나요?
  • 내 코드가 팀의 기존 코드를 망가뜨리지 않았는지 확인했나요?

🔗 관련 이슈 (Issue)

Close #

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moim-app Ready Ready Preview, Comment Jun 14, 2026 1:31pm

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 로그인 및 회원가입 후 기본 리다이렉트 경로를 대시보드로 변경했습니다.
    • OAuth 로그인 콜백 경로를 업데이트했습니다.
    • E2E 테스트의 네비게이션 흐름을 조정했습니다.

Walkthrough

인증 성공 후 기본 리다이렉트 경로를 /schedule/create에서 /dashboard로 일괄 변경. 이메일 로그인(handleSubmit, handleOAuthLogin), OAuth 회원가입(SocialButton), 네이버 두 콜백 라우트, E2E 테스트 waitForURL 대상이 모두 수정됨.

Changes

기본 리다이렉트 경로 변경 (/schedule/create → /dashboard)

Layer / File(s) Summary
로그인·회원가입·네이버 콜백 리다이렉트 변경
src/app/(auth)/login/page.tsx, src/app/(auth)/signup/page.tsx, src/app/api/auth/naver/callback/route.ts, src/app/api/naver/callback/route.ts
handleSubmit·handleOAuthLogin·SocialButton OAuth next 기본값, 그리고 네이버 두 콜백 라우트의 성공 리다이렉트 경로가 /schedule/create에서 /dashboard로 변경. URL 파라미터로 전달된 redirect/next 값이 있으면 기존 우선순위는 유지됨.
E2E waitForURL 갱신
e2e/calendar-integration.spec.ts, e2e/host-flow.spec.ts
로그인 후 waitForURL 패턴을 **/dashboard로 수정. host-flow.spec.ts는 대시보드 도달 대기 후 /schedule/create로 명시적으로 이동하는 순서로 재조정.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Siul49/moim#43: 동일 파일 src/app/api/naver/callback/route.ts에서 네이버 콜백 리다이렉트 로직을 구현/정의한 PR로, 이번 변경의 직접적인 원본 코드와 맞닿아 있음.

Suggested labels

feature

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR 설명이 템플릿 구조는 따르나 작업 내용과 변경 이유 섹션의 설명이 불완전하고 모호하며, 관련 이슈 번호가 미입력 상태입니다. 작업 내용에 구체적인 파일 변경사항과 영향 범위를 추가하고, 변경 이유를 명확히 작성하며, 관련 이슈 번호를 입력해야 합니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 'feat:' 접두사로 시작하고 변경 사항(로그인 후 리다이렉트 대상을 대시보드로 변경)을 명확하게 설명하고 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/32-schedule-ui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/(auth)/login/page.tsx (1)

50-57: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

리다이렉트 로직 중복 — 공용 유틸리티 함수 필수.

login/page.tsxsignup/page.tsx에서 동일한 쿼리 파라미터 검사 로직(redirect/next 추출 + 상대경로/외부URL 검증)이 3회 반복됨. 리다이렉트 정책 변경 시(예: 허용 경로 화이트리스트) 여러 곳 동시 수정 필요 → 누락 위험.

  • src/app/(auth)/login/page.tsx#L50-L57: handleSubmit 내 redirectUrl 결정 로직을 공용 함수로 추출
  • src/app/(auth)/login/page.tsx#L70-L79: handleOAuthLogin 내 next 결정 로직을 동일 함수로 대체
  • src/app/(auth)/signup/page.tsx#L334-L343: SocialButton.handleOAuthLogin 내 next 결정 로직을 동일 함수로 대체
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/`(auth)/login/page.tsx around lines 50 - 57, The redirect URL
validation logic that extracts and validates query parameters for redirect/next
values is duplicated across three locations: in the handleSubmit method (lines
50-57 of src/app/(auth)/login/page.tsx), in the handleOAuthLogin method (lines
70-79 of src/app/(auth)/login/page.tsx), and in the
SocialButton.handleOAuthLogin method (lines 334-343 of
src/app/(auth)/signup/page.tsx). Create a single shared utility function that
accepts optional current parameters and returns the validated redirect URL,
encapsulating the logic for extracting the redirect/next query parameter and
validating that it's either a relative path or not an external URL (contains no
"://"). Then replace the duplicated logic at all three locations with calls to
this utility function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/host-flow.spec.ts`:
- Around line 81-82: The code at lines 81-82 is safe, but add a defensive load
state verification before the waitFor call on line 83 to follow Playwright best
practices. After the page.goto call at line 82 and before the waitFor for page
elements, insert a page.waitForLoadState call (such as 'networkidle' or
'domcontentloaded') to ensure the page has fully loaded and the network is idle
before attempting to wait for and interact with page elements. This improves E2E
test stability and reliability.

---

Outside diff comments:
In `@src/app/`(auth)/login/page.tsx:
- Around line 50-57: The redirect URL validation logic that extracts and
validates query parameters for redirect/next values is duplicated across three
locations: in the handleSubmit method (lines 50-57 of
src/app/(auth)/login/page.tsx), in the handleOAuthLogin method (lines 70-79 of
src/app/(auth)/login/page.tsx), and in the SocialButton.handleOAuthLogin method
(lines 334-343 of src/app/(auth)/signup/page.tsx). Create a single shared
utility function that accepts optional current parameters and returns the
validated redirect URL, encapsulating the logic for extracting the redirect/next
query parameter and validating that it's either a relative path or not an
external URL (contains no "://"). Then replace the duplicated logic at all three
locations with calls to this utility function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 91942fa9-a947-428e-b959-b603e27bf1fd

📥 Commits

Reviewing files that changed from the base of the PR and between a1c527a and dd98904.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json, !package-lock.json
📒 Files selected for processing (6)
  • e2e/calendar-integration.spec.ts
  • e2e/host-flow.spec.ts
  • src/app/(auth)/login/page.tsx
  • src/app/(auth)/signup/page.tsx
  • src/app/api/auth/naver/callback/route.ts
  • src/app/api/naver/callback/route.ts

Comment thread e2e/host-flow.spec.ts
Comment on lines +81 to +82
await page.waitForURL("**/dashboard", { timeout: 60000 });
await page.goto("/schedule/create");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# /dashboard 페이지 구현 확인: 자동 리다이렉트 로직 유무, 비동기 데이터 페칭 여부
ast-grep --pattern $'export default function $_($$) {
  $$$
  redirect($$$)
  $$$
}' src/app/dashboard

# useEffect 내 네비게이션 로직 검색
rg -nP --type=tsx -C3 'useRouter|redirect|window\.location' src/app/dashboard

Repository: Siul49/moim

Length of output: 83


🏁 Script executed:

# dashboard 페이지 위치 확인
fd -e ts -e tsx "dashboard" src/app/

Repository: Siul49/moim

Length of output: 37


🏁 Script executed:

# dashboard 페이지 리다이렉트/네비게이션 로직 검색 (타입 지정 수정)
rg -nP --type ts,tsx -C3 'useRouter|redirect|window\.location' src/app/

Repository: Siul49/moim

Length of output: 86


🏁 Script executed:

# host-flow.spec.ts 전체 L75-90 구간 확인
sed -n '75,90p' e2e/host-flow.spec.ts

Repository: Siul49/moim

Length of output: 612


🏁 Script executed:

# dashboard 페이지 구현 전체 확인 (ast-grep 대신 rg로 export default 검색)
rg -A 20 'export default function|export const.*dashboard' src/app/dashboard --type ts,tsx

Repository: Siul49/moim

Length of output: 86


🏁 Script executed:

# dashboard 페이지 파일 확인 (경로 재검색)
find src/app -type d -name "dashboard"

Repository: Siul49/moim

Length of output: 73


🏁 Script executed:

# dashboard 관련 모든 파일 검색
find src -name "*dashboard*"

Repository: Siul49/moim

Length of output: 73


🏁 Script executed:

# (auth) 이후 로그인 후 이동 페이지 확인 - app 구조 조회
find src/app -type f \( -name "page.tsx" -o -name "layout.tsx" \) | head -20

Repository: Siul49/moim

Length of output: 591


🏁 Script executed:

# host-flow.spec.ts 전체 코드 읽기 (파일 크기 확인 후)
wc -l e2e/host-flow.spec.ts

Repository: Siul49/moim

Length of output: 81


🏁 Script executed:

# dashboard/page.tsx 구현 확인
cat src/app/dashboard/page.tsx

Repository: Siul49/moim

Length of output: 734


🏁 Script executed:

# host-flow.spec.ts 전체 코드 읽기 (127줄)
cat e2e/host-flow.spec.ts

Repository: Siul49/moim

Length of output: 4420


/dashboard 대기 후 바로 네비게이션 — 현 코드는 안전하나 방어적 로드 확인 추가 권장.

L81-82의 패턴 자체는 안전합니다. dashboard/page.tsx는 리다이렉트 로직 없는 서버 컴포넌트이고, waitForURL 완료는 리다이렉트 및 페이지 로드 시작을 의미하므로 L82의 goto와 충돌하지 않습니다. 다만 L83의 waitFor 앞에 명시적 로드 상태 확인을 추가하면 더욱 견고합니다.

Why: E2E 테스트 안정성 및 Playwright 모범 사례 (네트워크 유휴 상태 보장)
How: 페이지 요소 대기 전에 로드 완료 확인

 await page.waitForURL("**/dashboard", { timeout: 60000 });
 await page.goto("/schedule/create");
+
 const titleInput = page.getByLabel("모임 제목");
-await titleInput.waitFor({ state: "visible", timeout: 15000 });
+await page.waitForLoadState("networkidle");
+await titleInput.waitFor({ state: "visible", timeout: 15000 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/host-flow.spec.ts` around lines 81 - 82, The code at lines 81-82 is safe,
but add a defensive load state verification before the waitFor call on line 83
to follow Playwright best practices. After the page.goto call at line 82 and
before the waitFor for page elements, insert a page.waitForLoadState call (such
as 'networkidle' or 'domcontentloaded') to ensure the page has fully loaded and
the network is idle before attempting to wait for and interact with page
elements. This improves E2E test stability and reliability.

@yoohyun-1203
yoohyun-1203 merged commit fa9149e into dev Jun 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant