Skip to content

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Sep 5, 2025

작업 요약

토큰 재발급 로직 수정

Issue Link

#310

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신기능
    • 사용자 정보(전화번호/마케팅 동의) 업데이트 후 새로운 액세스 토큰을 즉시 반환합니다.
  • 리팩터링
    • 쿠키 기반 리프레시 토큰 흐름을 제거하고, 요청 본문에 포함된 액세스 토큰을 사용하도록 변경했습니다.
    • 사용자 정보 업데이트 요청에 accessToken 필드가 추가되었습니다.
    • 응답 형식이 변경되어 업데이트 성공 시 새 액세스 토큰을 담아 반환합니다.
  • 변경 사항 안내
    • 이 업데이트로 기존 쿠키 의존 호출은 동작이 달라질 수 있으니, 요청 본문에 액세스 토큰을 포함하도록 클라이언트를 업데이트하세요.

@Jjiggu Jjiggu self-assigned this Sep 5, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Sep 5, 2025
@Jjiggu Jjiggu merged commit 20b3512 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

액세스 토큰 기반으로 사용자 선택정보 업데이트 흐름을 변경. 컨트롤러와 서비스의 putOptional 시그니처/반환타입을 수정하고, 요청 DTO에 accessToken 필드를 추가. 새 액세스 토큰만 반환하는 NewAccessTokenResponse DTO를 신설. 쿠키 기반 리프레시 토큰 사용 로직 제거.

Changes

Cohort / File(s) Change summary
DTO 추가/수정
nowait-app-user-api/src/main/java/com/nowait/applicationuser/token/dto/NewAccessTokenResponse.java, nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/dto/UserUpdateRequest.java
NewAccessTokenResponse DTO 신설(불변, access_token 매핑, toString에서 토큰 제외). UserUpdateRequest 레코드에 accessToken 필드 추가로 시그니처 변경.
컨트롤러 흐름 변경
nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/controller/UserController.java
putOptional 엔드포인트에서 쿠키 리프레시 토큰 제거, 요청 바디의 accessToken 사용. 서비스 호출 시 인자/반환타입을 NewAccessTokenResponse로 변경.
서비스 로직/시그니처 변경
nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/service/UserService.java
putOptional(String, boolean, String)으로 시그니처 변경(전화번호, 동의, accessToken). 리프레시 토큰 처리 제거. 제공된 accessToken으로 사용자 정보 파생 후 새 액세스 토큰 발급 및 NewAccessTokenResponse로 반환.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as User
  participant C as UserController
  participant S as UserService
  participant T as TokenUtil/JWT

  User->>C: PUT /user (phoneNumber, consent, accessToken)
  C->>S: putOptional(phoneNumber, consent, accessToken)
  S->>T: Parse accessToken (userId, role)
  T-->>S: Claims
  S->>S: 사용자 정보 업데이트(전화번호/마케팅 동의)
  S->>T: 새 액세스 토큰 생성
  T-->>S: newAccessToken
  S-->>C: NewAccessTokenResponse(newAccessToken)
  C-->>User: 200 OK + { access_token }
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

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 1daae21 and ed039b6.

📒 Files selected for processing (4)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/token/dto/NewAccessTokenResponse.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/controller/UserController.java (2 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/dto/UserUpdateRequest.java (1 hunks)
  • nowait-app-user-api/src/main/java/com/nowait/applicationuser/user/service/UserService.java (3 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