Skip to content

Comments

[FEAT] 탈퇴 유저 예외처리 구현 (#353)#354

Merged
lingard1234 merged 2 commits intodevfrom
feat/353-loaduser
Feb 10, 2026
Merged

[FEAT] 탈퇴 유저 예외처리 구현 (#353)#354
lingard1234 merged 2 commits intodevfrom
feat/353-loaduser

Conversation

@lingard1234
Copy link
Contributor

Summary

탈퇴한 유저는 토큰이 발급 안되게 설정

Changes

OAuthErrorCode, CustomOAuth2UserService의 loadUser 메서드

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

참고 사항

@lingard1234 lingard1234 self-assigned this Feb 10, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lingard1234, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 탈퇴한 사용자가 시스템에 접근하여 토큰을 발급받는 것을 방지하기 위한 예외 처리 로직을 추가합니다. 이를 통해 보안을 강화하고, 사용자 상태 관리를 개선하여 애플리케이션의 안정성을 높입니다.

Highlights

  • 새로운 오류 코드 추가: 탈퇴한 사용자를 나타내는 WITHDRAWN_USER 오류 코드가 OAuthErrorCode에 추가되었습니다.
  • 탈퇴 유저 예외 처리 로직 구현: CustomOAuth2UserServiceloadUser 메서드에 사용자가 탈퇴 상태인지 확인하고, 탈퇴한 경우 WITHDRAWN_USER 예외를 발생시키는 로직이 추가되었습니다.
Changelog
  • src/main/java/com/example/RealMatch/oauth/code/OAuthErrorCode.java
    • 탈퇴한 사용자를 나타내는 WITHDRAWN_USER 오류 코드를 추가했습니다.
  • src/main/java/com/example/RealMatch/oauth/service/CustomOAuth2UserService.java
    • loadUser 메서드 내에서 사용자 로드 후, 해당 사용자가 탈퇴 상태(Role.WITHDRAWN 또는 isDeleted())인지 확인하는 로직을 추가했습니다.
    • 탈퇴한 사용자일 경우 WITHDRAWN_USER 예외를 발생시키도록 처리했습니다.
Activity
  • 이 PR에 대한 추가적인 코멘트, 리뷰 또는 진행 상황 활동은 아직 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

탈퇴한 유저의 로그인을 막기 위한 예외 처리가 추가되었네요. 코드 변경 사항을 확인했으며, 탈퇴 여부를 확인하는 로직을 더 명확하게 개선할 수 있는 부분이 있어 코멘트를 남깁니다.


// 탈퇴한 유저인지 확인
User user = authMethod.getUser();
if (user.getRole() == Role.WITHDRAWN || user.isDeleted()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

User 엔티티의 withdraw() 메서드는 isDeleted 플래그와 role을 모두 업데이트합니다. 따라서 이 두 조건을 || 연산자로 함께 검사하는 것은 중복으로 보입니다. 역할(role)을 기준으로 사용자의 상태를 확인하는 것이 더 명확하고 일관된 방법입니다.

Suggested change
if (user.getRole() == Role.WITHDRAWN || user.isDeleted()) {
if (user.getRole() == Role.WITHDRAWN) {

@lingard1234 lingard1234 merged commit 431dd9e into dev Feb 10, 2026
1 check passed
@lingard1234 lingard1234 deleted the feat/353-loaduser branch February 10, 2026 06:30
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