Skip to content

[FEATURE] 로그인 관련 수정#163

Merged
sunhwaaRj merged 5 commits intodevelopfrom
feature/#162-login-mod
Mar 29, 2026
Merged

[FEATURE] 로그인 관련 수정#163
sunhwaaRj merged 5 commits intodevelopfrom
feature/#162-login-mod

Conversation

@sunhwaaRj
Copy link
Copy Markdown
Contributor

@sunhwaaRj sunhwaaRj commented Mar 29, 2026

✅ PR 유형

어떤 변경 사항이 있었나요?

  • 새로운 기능 추가
  • 버그 수정
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📌 관련 이슈번호


✅ Key Changes

  • 네이버 로그인 버튼 삭제
  • 기타 에러 수정

📸 스크린샷 or 실행영상


🎸 기타 사항 or 추가 코멘트

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • 보호된 페이지에서 로그아웃 시 홈페이지로 올바르게 리다이렉트되도록 개선
    • 로그아웃 시 사용자 상태 초기화, 프로필 드롭다운 및 모바일 메뉴가 항상 닫히도록 안정화
    • 로그아웃 실패 시에도 정리 동작과 사용자 안내가 보장되도록 개선
  • 기타 변경

    • 소셜 로그인에서 Naver 제거(순서: Kakao, Google)
    • 게시물/프로젝트 편집 및 상세화면의 이미지 섹션 일시 제외(향후 복원 예정)
    • 댓글 하단 오버레이의 렌더/상호작용 처리 방식 최적화

@sunhwaaRj sunhwaaRj self-assigned this Mar 29, 2026
@sunhwaaRj sunhwaaRj added the FIX 버그 수정 label Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

Walkthrough

프로젝트/에디터에서 이미지 렌더링을 임시 제거하고(주석 처리), 로그아웃을 서버 API 호출로 변경하며 보호된 경로에서 로그아웃 시 홈으로 리다이렉트하도록 제어 흐름을 확장했습니다. 또한 BottomComment의 숨김 제어를 CSS display에서 pointerEvents 기반으로 전환하고, 로그인 소셜 버튼에서 네이버를 제거했습니다.

Changes

Cohort / File(s) Summary
프로젝트/에디터 이미지 비활성화
src/app/(main)/project/[id]/_components/ProjectInfo.tsx, src/components/recruit/editor/TextContent.tsx
ProjectImagePostImage 렌더 호출을 주석 처리하고 TODO 주석을 추가. 이미지 관련 UI를 일시 제거함.
로그아웃 API 및 헤더 변경
src/libs/api/auth.ts, src/components/common/Header.tsx
logout() API 추가. HeaderhandleLogout을 async로 변경해 서버 호출을 await하고, 실패 로깅 후 항상 사용자 상태 정리·토스트 표시·모바일 메뉴/프로필 닫기를 수행. 보호된 경로에서만 홈으로 리다이렉트하도록 조건 추가.
BottomComment 표시 제어 변경
src/app/(main)/teampsylog/_components/BottomComment.tsx
DOM은 항상 렌더링되도록 유지하고, block/hidden 토글 대신 pointerEvents: shouldShow ? 'auto' : 'none'로 상호작용 제어 방식 전환.
소셜 로그인 목록 변경
src/components/login/LoginSocialList.tsx
fixedOrder에서 naver 제거. 로그인 버튼 순서를 kakao, google로 변경.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User as 사용자
participant Header as Header 컴포넌트
participant AuthAPI as src/libs/api/auth.logout()
participant Server as 인증 서버
participant Store as 사용자 상태(Store/Context)
participant Router as Next.js Router
participant UI as UI (토스트/메뉴)

User->>Header: 로그아웃 클릭
Header->>AuthAPI: logout() 호출 (await)
AuthAPI->>Server: POST auth/logout
Server-->>AuthAPI: 200 / { isSuccess, result }
AuthAPI-->>Header: 응답 반환 / 에러 던짐 가능
alt 성공 또는 실패
    Header->>Store: 사용자 상태 초기화
    Header->>UI: 프로필 드롭다운 닫기, 모바일 메뉴 닫기, 토스트 표시
    Header->>Router: (보호된 경로였으면) router.push('/')
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • woneeeee
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning ProjectInfo.tsx와 TextContent.tsx의 이미지 컴포넌트 주석 처리, BottomComment.tsx의 포인터 이벤트 제어 변경은 이슈 #162 범위를 벗어난 변경사항입니다. ProjectInfo, TextContent, BottomComment의 변경사항들이 이슈 #162과 직접적인 연관이 없으므로, 별도의 이슈로 분리하거나 PR 설명을 보충하여 이러한 변경사항들의 필요성을 명확히 하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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의 주요 변경사항(로그인 관련 수정)을 반영하고 있으나, 변경사항의 구체적인 내용(네이버 버튼 삭제, 로그아웃 버튼 가시성 수정)을 명시하지 않아 다소 추상적입니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으며, 주요 변경사항(네이버 로그인 버튼 삭제, 기타 에러 수정)을 기재했으나, 스크린샷과 추가 코멘트 섹션이 미작성 상태입니다.
Linked Issues check ✅ Passed PR은 #162 이슈의 두 가지 주요 요구사항을 구현했습니다: (1) 네이버 로그인 버튼 삭제 [LoginSocialList.tsx], (2) 로그아웃 후 수정/삭제 버튼 가시성 수정 [Header.tsx의 로그아웃 처리 개선].

✏️ 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/#162-login-mod

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

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

⚠️ Outside diff range comments (1)
src/app/(main)/teampsylog/_components/BottomComment.tsx (1)

40-52: ⚠️ Potential issue | 🟠 Major

닫힌 상태에서 시트 내부 포커스가 살아있는 접근성 이슈가 있습니다.

현재는 pointerEvents: none만 적용되어 닫힌 상태(!shouldShow)에서도 키보드 Tab 포커스/스크린리더 접근이 가능합니다. 닫힐 때는 시트 자체를 접근성 트리/탭 순서에서 제외해 주세요.

수정 예시
-      <div
-        className="desktop:hidden fixed inset-x-0 bottom-0 z-50 flex rounded-t-2xl bg-gray-200"
+      <div
+        className={`desktop:hidden fixed inset-x-0 bottom-0 z-50 rounded-t-2xl bg-gray-200 ${
+          shouldShow ? 'flex' : 'hidden'
+        }`}
+        aria-hidden={!shouldShow}
         style={{
           height: '70vh',
           maxHeight: '70vh',
           flexDirection: 'column',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx around lines 40 -
52, The sheet remains keyboard/screen-reader focusable when closed because only
pointerEvents is toggled; update the BottomComment container (where isDragging,
isOpen, isClosing, shouldShow are used) to remove it from the accessibility tree
when closed by either unmounting it or adding accessibility attributes: set
aria-hidden={!shouldShow} and hidden={!shouldShow} (or apply display: 'none'
when !shouldShow), and/or add the inert attribute (or programmatically remove
tab stops) so no elements inside can receive focus while closed; ensure any
focus trap is released when shouldShow becomes false.
🧹 Nitpick comments (1)
src/components/login/LoginSocialList.tsx (1)

75-75: 네이버 제거가 확정이라면 관련 분기 정리를 후속으로 묶어 주세요.

Line [75]에서 버튼 노출만 제거된 상태라, 이 파일의 SocialType, handleNaverLogin, socialConfig.naver, 쿠키 allow-list(Line [68])와 분리되어 있습니다. 또한 src/app/(auth)/(callback)/naver/oauth/NaverCallback.tsx (Line 18-26, Line 36-41)에는 네이버 콜백 처리/쿠키 기록이 남아 있어 정책이 UI와 콜백에서 이원화되어 보입니다. 삭제 확정 정책이면 코드 경로를 함께 정리하는 쪽이 유지보수에 유리합니다.

필요하시면 네이버 관련 분기를 안전하게 정리하는 후속 패치 초안(타입/설정/쿠키/콜백 경로 정리)도 바로 작성해드릴게요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/login/LoginSocialList.tsx` at line 75, The code currently only
hides the Naver button but leaves related branches scattered; remove Naver
across types, handlers, config and cookie allow-list to avoid divergence: remove
'naver' from the SocialType union and the fixedOrder array, delete or inline
handleNaverLogin and any references to socialConfig.naver, update the cookie
allow-list to exclude Naver, and remove or refactor the Naver callback handling
in NaverCallback.tsx (cookie write/processing) so the UI, config, and callback
codepaths are consistent; ensure imports and any tests referencing 'naver' are
updated accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app/`(main)/project/[id]/_components/ProjectInfo.tsx:
- Around line 33-34: The ProjectImage component rendering was commented out in
ProjectInfo.tsx causing the project image to be hidden; revert that change by
restoring the JSX line that renders ProjectImage (remove the comment around
<ProjectImage {...data} />) so the component displays again — ProjectImage
(src/app/(main)/project/[id]/_components/ProjectImage.tsx) already returns null
when no image (lines ~4-20), so simply re-enable the <ProjectImage {...data} />
usage in ProjectInfo.tsx without adding extra guards.

In `@src/components/common/Header.tsx`:
- Around line 47-56: handleLogout currently only clears local state via
useUserStore.getState().clearUser(), which leaves server-side refresh
tokens/sessions active; change handleLogout to first call your logout API (e.g.,
auth.logout or POST /api/logout) to invalidate the server session, await its
result and handle errors, then on successful response clear local state
(useUserStore.getState().clearUser()), close dropdown/menu, show the toast, and
finally redirect (router.push('/')) if on a protected path; ensure any failure
still clears sensitive local state but surface an error toast/log for debugging.

In `@src/components/login/LoginSocialList.tsx`:
- Around line 74-75: 주석과 실제 값이 불일치합니다: 업데이트해야 할 부분은 상수 fixedOrder (type
SocialType) 선언 바로 위의 주석으로, 현재 실제 값은 ['kakao', 'google'] 이므로 주석을 "고정된 순서: 카카오,
구글"처럼 실제 렌더 순서와 일치하도록 수정하세요; 주석이 네이버를 포함하고 있으면 제거하거나 실제 배열에 네이버를 추가할지 결정 후 주석과
fixedOrder 값을 함께 일치시키면 됩니다.

In `@src/components/recruit/editor/TextContent.tsx`:
- Around line 93-94: Removing the <PostImage /> UI removed the effect in
PostImage.tsx that calls setValue('imageKeys', ...) and breaks image key sync;
restore that sync by explicitly initializing/preserving imageKeys when the
editor UI is disabled: add a useEffect in TextContent (or in RecruitForm where
initialImages is available) that calls the form's setValue('imageKeys',
initialImages || []) on mount and whenever initialImages changes, or reintroduce
a hidden PostImage-like helper component that re-runs the same logic from
PostImage.tsx (the setValue('imageKeys', ...) effect) so image keys are
preserved across save/update flows.

---

Outside diff comments:
In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx:
- Around line 40-52: The sheet remains keyboard/screen-reader focusable when
closed because only pointerEvents is toggled; update the BottomComment container
(where isDragging, isOpen, isClosing, shouldShow are used) to remove it from the
accessibility tree when closed by either unmounting it or adding accessibility
attributes: set aria-hidden={!shouldShow} and hidden={!shouldShow} (or apply
display: 'none' when !shouldShow), and/or add the inert attribute (or
programmatically remove tab stops) so no elements inside can receive focus while
closed; ensure any focus trap is released when shouldShow becomes false.

---

Nitpick comments:
In `@src/components/login/LoginSocialList.tsx`:
- Line 75: The code currently only hides the Naver button but leaves related
branches scattered; remove Naver across types, handlers, config and cookie
allow-list to avoid divergence: remove 'naver' from the SocialType union and the
fixedOrder array, delete or inline handleNaverLogin and any references to
socialConfig.naver, update the cookie allow-list to exclude Naver, and remove or
refactor the Naver callback handling in NaverCallback.tsx (cookie
write/processing) so the UI, config, and callback codepaths are consistent;
ensure imports and any tests referencing 'naver' are updated accordingly.
🪄 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: CHILL

Plan: Pro

Run ID: e05f2a3c-469e-4ae9-bf7f-ae74c91cc2cf

📥 Commits

Reviewing files that changed from the base of the PR and between 300074e and 2f31c28.

📒 Files selected for processing (5)
  • src/app/(main)/project/[id]/_components/ProjectInfo.tsx
  • src/app/(main)/teampsylog/_components/BottomComment.tsx
  • src/components/common/Header.tsx
  • src/components/login/LoginSocialList.tsx
  • src/components/recruit/editor/TextContent.tsx

Comment thread src/app/(main)/project/[id]/_components/ProjectInfo.tsx
Comment thread src/components/common/Header.tsx Outdated
Comment thread src/components/login/LoginSocialList.tsx
Comment thread src/components/recruit/editor/TextContent.tsx
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/components/common/Header.tsx (1)

48-57: ⚠️ Potential issue | 🟡 Minor

실패한 로그아웃에도 성공 토스트가 뜹니다.

Line 49-57에서 logout()이 예외를 던져도 finally에서 항상 로그아웃 완료되었습니다.를 보여 줍니다. 로컬 정리는 유지하되, 서버 로그아웃 실패 시에는 별도 메시지로 분기해야 사용자에게 상태를 잘못 전달하지 않습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/common/Header.tsx` around lines 48 - 57, In handleLogout,
currently the success toast in the finally block is shown even when logout()
throws; change the flow so that logout() is awaited inside try/catch: on success
call useUserStore.getState().clearUser(), close UI
(setIsProfileDropdownOpen(false), setIsMenuOpen(false)) and addToast with the
success message, while in catch still clear local state
(useUserStore.getState().clearUser(), close UI) but add a different error toast
(e.g., '로그아웃에 실패했습니다.' plus optional error info); remove the unconditional
addToast from the finally block so the toast is shown conditionally based on
success/failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/api/auth.ts`:
- Around line 4-5: The logout function triggers the global 401
retry/login-redirect interceptor because it uses the default api client; change
logout (exported logout) to call a dedicated HTTP client that bypasses the
shared 401 interceptor (or use an existing option on the client to disable
interceptors) so the logout request does not trigger token-refresh/retry or
redirect logic. Locate the logout function and replace its use of api.post with
a no-interceptor client (e.g. apiNoRetry / apiWithoutAuthInterceptor) or create
such a client in the same module that clones the axios instance without the 401
handler; ensure CommonResponse<string> is preserved and that other logic in
logout remains unchanged.

---

Duplicate comments:
In `@src/components/common/Header.tsx`:
- Around line 48-57: In handleLogout, currently the success toast in the finally
block is shown even when logout() throws; change the flow so that logout() is
awaited inside try/catch: on success call useUserStore.getState().clearUser(),
close UI (setIsProfileDropdownOpen(false), setIsMenuOpen(false)) and addToast
with the success message, while in catch still clear local state
(useUserStore.getState().clearUser(), close UI) but add a different error toast
(e.g., '로그아웃에 실패했습니다.' plus optional error info); remove the unconditional
addToast from the finally block so the toast is shown conditionally based on
success/failure.
🪄 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: CHILL

Plan: Pro

Run ID: 5040713c-6940-4921-b869-3907ef583720

📥 Commits

Reviewing files that changed from the base of the PR and between 2f31c28 and 03f0fcc.

📒 Files selected for processing (2)
  • src/components/common/Header.tsx
  • src/libs/api/auth.ts

Comment thread src/libs/api/auth.ts
Comment on lines +4 to +5
export async function logout() {
const { data } = await api.post<CommonResponse<string>>('auth/logout');
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 | 🟠 Major

로그아웃 요청에 공용 401 재발급 인터셉터가 그대로 걸립니다.

Line 5는 src/libs/api/api.ts:43-67의 401 재시도//login 리다이렉트 경로를 그대로 타기 때문에, 액세스 토큰이 만료된 상태에서 로그아웃하면 세션을 한 번 더 연장하거나 의도치 않게 /login으로 튈 수 있습니다. 로그아웃 요청만큼은 이 인터셉터를 우회하는 별도 클라이언트나 예외 분기가 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/api/auth.ts` around lines 4 - 5, The logout function triggers the
global 401 retry/login-redirect interceptor because it uses the default api
client; change logout (exported logout) to call a dedicated HTTP client that
bypasses the shared 401 interceptor (or use an existing option on the client to
disable interceptors) so the logout request does not trigger token-refresh/retry
or redirect logic. Locate the logout function and replace its use of api.post
with a no-interceptor client (e.g. apiNoRetry / apiWithoutAuthInterceptor) or
create such a client in the same module that clones the axios instance without
the 401 handler; ensure CommonResponse<string> is preserved and that other logic
in logout remains unchanged.

@sunhwaaRj sunhwaaRj merged commit 655d7f7 into develop Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FIX 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 로그인 관련 수정

1 participant