Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Sep 5, 2025

작업 요약

토큰 재발급 로직 수정

Issue Link

#310

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 버그 수정
    • 선택 정보(전화번호·동의) 업데이트 과정의 세션 처리 안정성을 개선하여 간헐적 인증 오류를 완화했습니다.
    • 만료된 세션으로 인한 요청 실패 가능성을 줄여, 재로그인 빈도를 낮췄습니다.
    • 쿠키 기반 인증 흐름을 정비해 업데이트 요청의 성공률을 향상했습니다.

@Jjiggu Jjiggu self-assigned this Sep 5, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Sep 5, 2025
@Jjiggu Jjiggu merged commit 1daae21 into develop Sep 5, 2025
1 of 2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Sep 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

/users/optional-infoaccessToken 쿠키 대신 refreshToken 쿠키를 바인딩하고 사용하도록 컨트롤러와 서비스 시그니처 및 내부 로직을 일관되게 변경. 널 체크와 서비스 호출 인자, 토큰 파생(사용자 ID/역할) 및 토큰 갱신 시 기존 토큰 참조가 모두 refreshToken으로 교체.

Changes

Cohort / File(s) Summary
토큰 소스 전환: accessToken → refreshToken
nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/controller/UserController.java, nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/service/UserService.java
컨트롤러 putOptional의 쿠키 바인딩과 널 체크 키를 refreshToken으로 변경. 서비스 putOptional(String refreshToken, ...)로 시그니처 변경 및 내부에서 사용자 식별/권한 파생 및 기존 토큰 참조에 refreshToken 사용. 에러 메시지 문자열은 그대로 유지.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant C as Client
    participant UC as UserController
    participant US as UserService
    participant TS as Token/Auth Logic

    C->>UC: PUT /users/optional-info (Cookie: refreshToken)
    UC->>UC: refreshToken null 체크
    alt refreshToken 없음
        UC-->>C: 400 "accessToken not found in cookies"
    else refreshToken 있음
        UC->>US: putOptional(refreshToken, phoneNumber, consent)
        US->>TS: refreshToken 검증/파싱 → userId, role
        TS-->>US: userId, role
        US->>US: 선택 정보 업데이트 및 토큰 갱신 준비
        US->>TS: 기존=refreshToken 기반 토큰 갱신
        TS-->>US: AuthenticationResponse
        US-->>UC: AuthenticationResponse
        UC-->>C: 200 AuthenticationResponse
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • HyemIin

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba12e6 and f4feeaf.

📒 Files selected for processing (2)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/controller/UserController.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/service/UserService.java (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#310-phoneNumber

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants