Skip to content

✨ User CRUD, 로컬 로그인, 구글 로그인 구현#6

Merged
tteokgook1 merged 10 commits intomainfrom
feat/auth
Jan 8, 2026
Merged

✨ User CRUD, 로컬 로그인, 구글 로그인 구현#6
tteokgook1 merged 10 commits intomainfrom
feat/auth

Conversation

@tteokgook1
Copy link
Collaborator

@tteokgook1 tteokgook1 commented Jan 7, 2026

이 PR이 어떤 기능을 추가했나요?

  • id,pw 활용 로컬 로그인 구현
  • JWT, 쿠키 기반 사용자 인증 구현
  • 사용자 로컬 회원가입, 본인 정보 확인, 비밀번호 변경, 탈퇴 구현
  • 구글 로그인 및 자동 회원가입 구현

주의해야 할 점이나 유의사항이 있나요?

  • 구글 로그인 시 회원이 아니라면 자동으로 회원가입됩니다.
  • 비밀번호 변경은 로컬 로그인 사용자만 가능합니다.
  • /oauth2/authorization/google로 GET 요청을 보내면 구글 로그인 화면으로 넘어갑니다.
  • 사용자 인증은 AUTH-TOKEN 쿠키를 사용합니다.
  • 구글 client id, secret은 루트 경로 .env 파일에 작성합니다.

@hyun-1210
Copy link
Collaborator

@tteokgook1 제가 열심히 보고 있는데 코드 읽는 속도가 느려서 새벽까지 해서 한꺼번에 리뷰 올리겠습니다!

@tteokgook1
Copy link
Collaborator Author

@tteokgook1 제가 열심히 보고 있는데 코드 읽는 속도가 느려서 새벽까지 해서 한꺼번에 리뷰 올리겠습니다!

아직 완성이 안 된 거긴 해요

@hyun-1210
Copy link
Collaborator

@tteokgook1 제가 열심히 보고 있는데 코드 읽는 속도가 느려서 새벽까지 해서 한꺼번에 리뷰 올리겠습니다!

아직 완성이 안 된 거긴 해요

아 그럼 천천히 해보겠습니다 ㅋㅋㅋㅋ

Copy link
Collaborator

@hyun-1210 hyun-1210 left a comment

Choose a reason for hiding this comment

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

일단 수정하고 계시다 해서 조금 리뷰 한것만 먼저 올립니다!

Copy link
Collaborator

@hyun-1210 hyun-1210 left a comment

Choose a reason for hiding this comment

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

리뷰 추가했습니다.

@hyun-1210
Copy link
Collaborator

Auth, User test 잘 통과되나요??

@tteokgook1 tteokgook1 marked this pull request as ready for review January 8, 2026 01:20
@tteokgook1
Copy link
Collaborator Author

Auth, User test 잘 통과되나요??

CI 통과되는지 보면 확인할 수 있어요

image

@tteokgook1 tteokgook1 marked this pull request as draft January 8, 2026 01:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a comprehensive user authentication system with both local (username/password) and Google OAuth2 login capabilities. The implementation uses JWT tokens stored in HTTP-only cookies for session management and provides complete user CRUD operations.

Key Changes:

  • JWT-based authentication with cookie storage for secure session management
  • Local registration and login with BCrypt password hashing
  • Google OAuth2 integration with automatic user creation
  • User profile management endpoints (view, update password, delete account)

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
build.gradle.kts Added Spring Security, OAuth2, JWT, and Jackson Kotlin dependencies
src/main/resources/application.yml Migrated from .properties to .yml, added JWT and OAuth2 configuration
src/main/resources/application-{local,prod}.yml Added profile-specific frontend URL configuration
src/main/kotlin/.../user/model/User.kt Created User entity with support for both local and OAuth authentication
src/main/kotlin/.../user/repository/UserRepository.kt Added repository with queries for both localId and oauthId
src/main/kotlin/.../user/service/UserService.kt Implemented local registration, login, password update, and account deletion
src/main/kotlin/.../user/service/GoogleOAuth2UserService.kt OAuth2 service for Google login with automatic user creation
src/main/kotlin/.../user/controller/AuthController.kt Auth endpoints for registration, login, and logout
src/main/kotlin/.../user/controller/UserController.kt User management endpoints for profile operations
src/main/kotlin/.../user/JwtProvider.kt JWT token generation, validation, and cookie management
src/main/kotlin/.../user/JwtAuthenticationFilter.kt Filter to extract and validate JWT from cookies
src/main/kotlin/.../user/UserArgumentResolver.kt Resolver to inject authenticated User into controller methods
src/main/kotlin/.../user/OAuth2SuccessHandler.kt Success handler for OAuth2 flow to create JWT cookie
src/main/kotlin/.../user/UserException.kt Exception hierarchy for user-related errors
src/main/kotlin/.../config/SecurityConfig.kt Spring Security configuration with OAuth2 and BCrypt setup
src/main/kotlin/.../config/WebConfig.kt CORS and custom argument resolver configuration
src/main/kotlin/.../config/JacksonConfig.kt Jackson ObjectMapper configuration with Kotlin support
src/main/kotlin/.../DomainException.kt Base exception class for domain errors
src/main/kotlin/.../GlobalControllerExceptionHandler.kt Global exception handler for DomainException
src/test/resources/application-test.yml Migrated test configuration to YAML with Testcontainers setup
src/test/kotlin/.../helper/DataGenerator.kt Test helper for generating users with tokens
src/test/kotlin/.../AuthTests.kt Comprehensive tests for registration, login, and logout
src/test/kotlin/.../UserTests.kt Tests for user profile, password update, and account deletion
src/test/kotlin/.../CrawlerTests.kt Updated to use SpringBootTest with full application context
.github/workflows/cd.yml Added JWT secret generation and OAuth environment variables
Dockerfile Added prod profile activation
README.md Added documentation for environment setup and OAuth flow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tteokgook1 tteokgook1 marked this pull request as ready for review January 8, 2026 02:48
@tteokgook1
Copy link
Collaborator Author

@hyun-1210

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 37 changed files in this pull request and generated 20 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Jan 8, 2026

@tteokgook1 I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

@tteokgook1
Copy link
Collaborator Author

@hyun-1210

Copy link
Collaborator

@hyun-1210 hyun-1210 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다

@tteokgook1 tteokgook1 merged commit d9a96be into main Jan 8, 2026
1 check passed
@tteokgook1 tteokgook1 deleted the feat/auth branch January 8, 2026 16:08
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.

3 participants