Skip to content

Conversation

@ggamnunq
Copy link
Contributor

@ggamnunq ggamnunq commented Aug 19, 2025

  • 로그인 관련 API URI 일부 변경
  • SecurityConfig 설정 변경( 로그인 경로 )
  • User 필드 추가 ( loginType, passwordHash )

Summary by CodeRabbit

  • 신기능
    • 로컬 회원가입/로그인 엔드포인트 추가(입력 유효성 검증 포함).
    • 로컬 로그인 시 액세스 토큰 반환.
  • 변경
    • 게스트 로그인 경로 변경: /users/guest/login → /users/login/guest.
  • 보안/접근성
    • 인증 없이 접근 가능한 경로에 /users/login/, /users/signup/ 추가.
  • 오류 처리
    • 신규 에러 코드 추가: 이미 존재하는 이메일, 이메일 형식 오류, 비밀번호 불일치.
  • 기타
    • 사용자 계정에 로그인 유형 구분 도입(게스트/로컬/카카오)으로 로그인 흐름 정교화.

  - 로그인 관련 API URI 일부 변경
  - SecurityConfig 설정 변경( 로그인 경로 )
  - User 필드 추가 ( loginType, passwordHash )
@ggamnunq ggamnunq self-assigned this Aug 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

로컬 회원가입/로그인 기능이 추가되었고, 게스트 로그인 경로가 변경되었다. User 엔티티에 비밀번호 해시와 로그인 타입이 도입되었으며, 서비스 레이어는 LoginType 기반 흐름으로 확장되었다. 보안 설정과 에러 코드가 이에 맞게 보강되었고, DTO/리포지토리도 추가·수정되었다.

Changes

Cohort / File(s) Change Summary
Controller: UserAuth
src/main/kotlin/busanVibe/busan/domain/user/controller/UserAuthController.kt
로컬 로그인/회원가입 엔드포인트 추가(/users/login/local, /users/signup/local), 검증 적용, 게스트 로그인 경로 /guest/login/login/guest로 변경
DTOs: Login Requests/Responses
.../user/data/dto/login/UserLoginRequestDTO.kt, .../user/data/dto/login/UserLoginResponseDTO.kt
요청 DTO 신설(LocalSignUpDto, LocalLoginDto) 및 필드 검증 추가; 응답의 LoginDto를 companion object 내 클래스 → 중첩 data class로 변경
Domain: User Entity & LoginType
.../user/data/User.kt, .../user/enums/LoginType.kt
User에 passwordHash(nullable)와 loginType(enum) 추가, getPassword()passwordHash 반환; LoginType enum(GUEST, LOCAL, KAKAO) 신설
Repository: User
.../user/repository/UserRepository.kt
existsByEmail(email: String): Boolean 추가
Service: UserCommandService
.../user/service/UserCommandService.kt
PasswordEncoder 주입, 로컬 로그인/회원가입 메서드 추가, isNewUserLoginType 기반으로 사용자 생성/토큰 발급 흐름 처리, 로깅에 로그인 타입 표기
Error Codes
.../global/apiPayload/code/status/ErrorStatus.kt
로그인 관련 에러 상수 추가: SIGNUP_EMAIL_EXISTS, INVALID_EMAIL_STYLE, LOGIN_INVALID_PASSWORD
Security Config
.../global/config/security/SecurityConfig.kt
/users/login/**, /users/signup/** 공개 접근 허용 경로에 추가

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Controller as UserAuthController
  participant Service as UserCommandService
  participant Repo as UserRepository
  participant Encoder as PasswordEncoder

  rect rgba(224,247,250,0.6)
  note over Client,Service: 로컬 회원가입 (POST /users/signup/local)
  Client->>Controller: LocalSignUpDto(email, password)
  Controller->>Service: localSignUp(dto)
  Service->>Repo: existsByEmail(email)?
  alt 이메일 존재함
    Service-->>Controller: throw SIGNUP_EMAIL_EXISTS
    Controller-->>Client: 400 LOGIN4001
  else 신규
    Service->>Encoder: encode(password)
    Service->>Repo: save(User(email, passwordHash, loginType=LOCAL))
    Service-->>Controller: Unit
    Controller-->>Client: 200 OK (no body)
  end
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant Controller as UserAuthController
  participant Service as UserCommandService
  participant Repo as UserRepository
  participant Encoder as PasswordEncoder
  participant JWT as TokenProvider

  rect rgba(232,245,233,0.6)
  note over Client,JWT: 로컬 로그인 (POST /users/login/local)
  Client->>Controller: LocalLoginDto(email, password)
  Controller->>Service: localLogin(dto)
  Service->>Repo: findByEmail(email)
  alt 사용자 없음
    Service-->>Controller: throw USER_NOT_FOUND
    Controller-->>Client: 404 USER_NOT_FOUND
  else 사용자 있음
    Service->>Encoder: matches(raw, passwordHash)
    alt 비밀번호 불일치
      Service-->>Controller: throw LOGIN_INVALID_PASSWORD
      Controller-->>Client: 400 LOGIN4003
    else 비밀번호 일치
      Service->>JWT: generateToken(user)
      Service-->>Controller: UserLoginResponseDTO.LoginDto(token, ...)
      Controller-->>Client: 200 OK (ApiResponse<TokenResponseDto>)
    end
  end
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant Controller as UserAuthController
  participant Service as UserCommandService
  participant Repo as UserRepository
  participant JWT as TokenProvider

  rect rgba(255,249,196,0.6)
  note over Client,Service: 게스트/카카오 로그인 공통 흐름 (isNewUser with LoginType)
  Client->>Controller: 로그인 요청 (Guest/Kakao)
  Controller->>Service: guestLogin()/loginOrRegisterByKakao()
  Service->>Repo: findByExternalIdOrEmail(...)
  alt 기존 사용자
    Service->>JWT: generateToken(user)
    Service-->>Controller: LoginDto(token, isNewUser=false)
  else 신규 사용자
    Service->>Repo: save(User(..., loginType=GUEST/KAKAO))
    Service->>JWT: generateToken(newUser)
    Service-->>Controller: LoginDto(token, isNewUser=true)
  end
  Controller-->>Client: 200 OK
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

새벽 코드를 톡톡 두드린 발,
로컬 로그인, 토큰이 반짝 발랄!
해시를 품은 당근 비밀창고,
게스트 길도 살짝 옆으로.
깡총! 나는 토끼, PR에 박수 짝짝—
이메일은 정확히, 비밀번호는 꽉!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 85a2a93 and f9374ce.

📒 Files selected for processing (9)
  • src/main/kotlin/busanVibe/busan/domain/user/controller/UserAuthController.kt (2 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/data/User.kt (2 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/data/dto/login/UserLoginRequestDTO.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/data/dto/login/UserLoginResponseDTO.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/enums/LoginType.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/repository/UserRepository.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/user/service/UserCommandService.kt (5 hunks)
  • src/main/kotlin/busanVibe/busan/global/apiPayload/code/status/ErrorStatus.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/global/config/security/SecurityConfig.kt (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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? Join our Discord community 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 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.

@ggamnunq ggamnunq merged commit 246db27 into main Aug 19, 2025
1 of 2 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.

2 participants