-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] Member&Auth 구현 완료 #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
442fb47
merge 성공
SungMinju 8220906
merge 성공
SungMinju 5d487f8
[feature]: user 엔티티 설계
SungMinju f31624d
merge 오류 수정
SungMinju af53b10
[Feature] JWT 생성
SungMinju f84b769
[FIX] 오류 수정
SungMinju 37be66f
[FIX] User 엔티티 설정 수정
SungMinju 8307545
[Feature] User 컨버터 구현
SungMinju c89395e
[FIX] 오류 수정
SungMinju e271230
[FIX] 설정값 수정
SungMinju 16e29ee
[Refactor] 코드 구조 변경
SungMinju dcc3412
[Refactor] 코드 구조 변경
SungMinju 107a30c
[Fix] 오류 응답 구조 변경으로 인한 오류 수정
SungMinju 9943956
[Feat] 약관동의 추가
SungMinju 32482b8
[Fix] 약관동의 dto 추가
SungMinju 8d19b22
[Fix] 약관동의 dto 추가
SungMinju c849010
[Fix] refresh token dto 삭제
SungMinju 4acbc09
[Fix] 유저 컨버터 코드 추가
SungMinju af9b5a4
[Refactor] Refresh Token 전달 방식 변경
SungMinju 0239089
[Feat] Auth 로직 구현
SungMinju dfc0983
[Feat] Refresh Token 쿠키 저장 로직 구현
SungMinju d3d6f19
[Style] import 구문 수정
SungMinju ab72c3a
[Feat] 코드 추가
SungMinju af75e6c
[Feat] 오류메세지 추가
SungMinju 9578c2d
[Feat] 회원가입/로그인 코드 구현
SungMinju a0410ad
Merge 성공
SungMinju 379112a
Merge 과정 중 코드 생략 오류 수정
SungMinju 6e49016
[Chore] BaseEntity import 경로 수정
SungMinju e4604fa
[Fix] cors 코드 수정
SungMinju 09e7154
[Fix] cors 코드 수정
SungMinju 2b5ff86
[Feat] 에러상태 코드 추가
SungMinju 4316265
[Feat] S3 이미지 설정 코드 추가
SungMinju f360a57
[Fix] 프로필 이미지 변수 제거
SungMinju 6d46ef5
[Fix] 회원 정보 수정 API 분리
SungMinju 5a4ff0c
[Fix] 코드래빗 리뷰 수정사항 반영
SungMinju cb5902f
[Feat] 회원가입 시 Term(약관) 엔티티 저장 로직 추가
SungMinju dcbac96
[Refactor] @PasswordMatch 검증기 범용성 확대
SungMinju ac07dbc
[Refactor] @PasswordMatch 검증기 범용성 확대
SungMinju 22a93d2
[Feat] 회원가입 시 Term(약관) 엔티티 저장 로직 추가
SungMinju 931b6ac
[Fix] 프로필 업데이트 롤백 시 S3 파일 정리 로직 추가
SungMinju 6f6b2a5
[Fix] 로그아웃 시 리프레시 토큰 쿠키 삭제 처리
SungMinju 592b436
[Refactor] @PasswordMatch 검증기 범용성 확대
SungMinju dc56c8c
[Refactor] @PasswordMatch 검증기 범용성 확대
SungMinju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/eatsfine/eatsfine/domain/businesshours/entity/BusinessHours.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/eatsfine/eatsfine/domain/tableblock/entity/TableBlock.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/eatsfine/eatsfine/domain/tableimage/entity/TableImage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/eatsfine/eatsfine/domain/term/entity/Term.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.eatsfine.eatsfine.domain.term.entity; | ||
|
|
||
| import com.eatsfine.eatsfine.domain.user.entity.User; | ||
| import com.eatsfine.eatsfine.global.common.BaseEntity; | ||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Table(name = "term") | ||
| public class Term extends BaseEntity { | ||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, orphanRemoval = true) | ||
| @JoinColumn(name = "user_id", nullable = false, unique = true) | ||
| private User user; | ||
|
|
||
| @Column(name = "tos_consent", nullable = false) | ||
| private Boolean tosConsent; | ||
|
|
||
| @Column(name = "privacy_consent", nullable = false) | ||
| private Boolean privacyConsent; | ||
|
|
||
| @Column(name = "marketing_consent", nullable = false) | ||
| private Boolean marketingConsent; | ||
|
|
||
| } |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/eatsfine/eatsfine/domain/term/repository/TermRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.eatsfine.eatsfine.domain.term.repository; | ||
|
|
||
| import com.eatsfine.eatsfine.domain.term.entity.Term; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| @Repository | ||
| public interface TermRepository extends JpaRepository<Term, Long> { | ||
|
|
||
| } |
130 changes: 130 additions & 0 deletions
130
src/main/java/com/eatsfine/eatsfine/domain/user/controller/UserController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,134 @@ | ||
| package com.eatsfine.eatsfine.domain.user.controller; | ||
|
|
||
|
|
||
| import com.eatsfine.eatsfine.domain.user.dto.request.UserRequestDto; | ||
| import com.eatsfine.eatsfine.domain.user.dto.response.UserResponseDto; | ||
| import com.eatsfine.eatsfine.domain.user.exception.UserException; | ||
| import com.eatsfine.eatsfine.domain.user.service.UserService; | ||
| import com.eatsfine.eatsfine.domain.user.status.UserErrorStatus; | ||
| import com.eatsfine.eatsfine.global.apiPayload.ApiResponse; | ||
| import com.eatsfine.eatsfine.global.auth.AuthCookieProvider; | ||
| import com.eatsfine.eatsfine.global.config.jwt.JwtTokenProvider; | ||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
|
|
||
| import jakarta.servlet.http.HttpServletRequest; | ||
| import jakarta.validation.Valid; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.http.HttpHeaders; | ||
| import org.springframework.http.MediaType; | ||
| import org.springframework.http.ResponseCookie; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
|
|
||
| @Tag(name = "User", description = "회원 관리 API") | ||
| @Slf4j | ||
| @RestController | ||
| @RequiredArgsConstructor | ||
| public class UserController { | ||
| private final UserService userService; | ||
| private final JwtTokenProvider jwtTokenProvider; | ||
| private final AuthCookieProvider authCookieProvider; | ||
|
|
||
| @PostMapping("/api/auth/signup") | ||
| @Operation(summary = "회원가입 API", description = "회원가입을 처리하는 API입니다.") | ||
| public ResponseEntity<UserResponseDto.JoinResultDto> signup(@RequestBody @Valid UserRequestDto.JoinDto joinDto) { | ||
| UserResponseDto.JoinResultDto result = userService.signup(joinDto); | ||
| return ResponseEntity.ok(result); | ||
| } | ||
|
|
||
| @PostMapping("/api/auth/login") | ||
| @Operation(summary = "로그인 API", description = "사용자 로그인을 처리하는 API입니다.") | ||
| public ResponseEntity<ApiResponse<UserResponseDto.LoginResponseDto>> login(@RequestBody UserRequestDto.LoginDto loginDto) { | ||
| UserResponseDto.LoginResponseDto loginResult = userService.login(loginDto); | ||
|
|
||
| if (loginResult.getRefreshToken() == null || loginResult.getRefreshToken().isBlank()) { | ||
| throw new UserException(UserErrorStatus.REFRESH_TOKEN_NOT_ISSUED); | ||
| } | ||
|
|
||
| ResponseCookie refreshCookie = authCookieProvider.refreshTokenCookie(loginResult.getRefreshToken()); | ||
|
|
||
| UserResponseDto.LoginResponseDto body = UserResponseDto.LoginResponseDto.builder() | ||
| .id(loginResult.getId()) | ||
| .accessToken(loginResult.getAccessToken()) | ||
| .refreshToken(null) | ||
| .build(); | ||
|
|
||
| return ResponseEntity.ok() | ||
| .header(HttpHeaders.SET_COOKIE, refreshCookie.toString()) | ||
| .body(ApiResponse.onSuccess(body)); | ||
| } | ||
|
Comment on lines
+45
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing The 🛡️ Proposed fix- public ResponseEntity<ApiResponse<UserResponseDto.LoginResponseDto>> login(`@RequestBody` UserRequestDto.LoginDto loginDto) {
+ public ResponseEntity<ApiResponse<UserResponseDto.LoginResponseDto>> login(`@RequestBody` `@Valid` UserRequestDto.LoginDto loginDto) {🤖 Prompt for AI Agents |
||
|
|
||
| @GetMapping("/api/v1/member/info") | ||
| @Operation( | ||
| summary = "유저 내 정보 조회 API - 인증 필요", | ||
| description = "유저가 내 정보를 조회하는 API입니다.", | ||
| security = {@SecurityRequirement(name = "JWT")} | ||
| ) | ||
| public ApiResponse<UserResponseDto.UserInfoDto> getMyInfo(HttpServletRequest request) { | ||
| return ApiResponse.onSuccess(userService.getMemberInfo(request)); | ||
| } | ||
|
|
||
|
|
||
| @PatchMapping(value = "/api/v1/member/info") | ||
| @Operation( | ||
| summary = "닉네임/전화번호 수정 API - 인증 필요", | ||
| description = "닉네임/전화번호만 수정합니다. (JSON)", | ||
| security = {@SecurityRequirement(name = "JWT")} | ||
| ) | ||
| public ResponseEntity<ApiResponse<String>> updateMyInfoText( | ||
| @RequestBody @Valid UserRequestDto.UpdateDto updateDto, HttpServletRequest request | ||
| ) { | ||
| String result = userService.updateMemberInfo(updateDto, null, request); | ||
| return ResponseEntity.ok(ApiResponse.onSuccess(result)); | ||
| } | ||
|
|
||
|
|
||
| @PutMapping( | ||
| value = "/api/v1/member/profile-image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) | ||
| @Operation( | ||
| summary = "프로필 이미지 수정 API - 인증 필요", | ||
| description = "프로필 이미지만 수정합니다. (multipart/form-data)", | ||
| security = {@SecurityRequirement(name = "JWT")} | ||
| ) | ||
| public ResponseEntity<ApiResponse<String>> updateProfileImage( | ||
| @RequestPart(value = "profileImage") MultipartFile profileImage, | ||
| HttpServletRequest request | ||
| ) { | ||
| String result = userService.updateMemberInfo(null, profileImage, request); | ||
| return ResponseEntity.ok(ApiResponse.onSuccess(result)); | ||
| } | ||
|
|
||
|
|
||
| @DeleteMapping("/api/auth/withdraw") | ||
| @Operation( | ||
| summary = "회원 탈퇴 API - 인증 필요", | ||
| description = "회원 탈퇴 기능 API입니다.", | ||
| security = {@SecurityRequirement(name = "JWT")} | ||
| ) | ||
| public ResponseEntity<?> withdraw(HttpServletRequest request) { | ||
| userService.withdraw(request); | ||
| return ResponseEntity.ok(ApiResponse.onSuccess("회원 탈퇴가 완료되었습니다.")); | ||
| } | ||
|
|
||
|
|
||
| @DeleteMapping("/api/auth/logout") | ||
| @Operation( | ||
| summary = "회원 로그아웃 API - 인증 필요", | ||
| description = "회원 로그아웃 기능 API입니다.", | ||
| security = {@SecurityRequirement(name = "JWT")} | ||
| ) | ||
| public ResponseEntity<ApiResponse<String>> logout(HttpServletRequest request) { | ||
| userService.logout(request); | ||
| ResponseCookie clearCookie = authCookieProvider.clearRefreshTokenCookie(); | ||
| return ResponseEntity.ok() | ||
| .header(HttpHeaders.SET_COOKIE, clearCookie.toString()) | ||
| .body(ApiResponse.onSuccess("로그아웃이 되었습니다.")); | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
io.jsonwebtoken jjwt latest version 2025 2026💡 Result:
As of February 3, 2026, the latest JJWT (
io.jsonwebtoken) release is0.13.0. [1][2]0.13.0):jjwt-api,jjwt-impl,jjwt-jackson,jjwt-gson, etc. [2]io.jsonwebtoken:jjwt-bom:0.13.0(Aug 20, 2025). [3]Gradle (recommended via BOM):
Maven:
Sources
[1] GitHub Releases – jwtk/jjwt (shows latest release
0.13.0)[2] javadoc.io – io.jsonwebtoken artifacts (shows latest version
0.13.0)[3] mvnrepository –
io.jsonwebtoken:jjwt-bom(shows latest0.13.0, dated Aug 20, 2025)🌐 Web query:
CVE io.jsonwebtoken jjwt 0.11.5 security vulnerabilities💡 Result:
For io.jsonwebtoken (jjwt) 0.11.5, the main publicly tracked issue you’ll see in scanners is:
#930. [3]io.jsonwebtoken:jjwt-impl. [4]Are there other CVEs for jjwt 0.11.5?
From the sources above, CVE-2024-31033 is the one commonly associated with jjwt 0.11.5; other “JWT CVEs” you might encounter are typically for different libraries/products with similar names.
Practical guidance
jjwt-impllatest as 0.13.0 and “latest non vulnerable version” as 0.13.0. [5]Sources:
[1] NVD – CVE-2024-31033 https://nvd.nist.gov/vuln/detail/CVE-2024-31033
[2] OSV – GHSA-r65j-6h5f-4f92 (withdrawn) https://osv.dev/vulnerability/GHSA-r65j-6h5f-4f92
[3] jwtk/jjwt Issue
#930jwtk/jjwt#930[4] GitLab Advisory DB (marked false positive) https://advisories.gitlab.com/pkg/maven/io.jsonwebtoken/jjwt-impl/CVE-2024-31033/
[5] Snyk package page for
jjwt-impl@0.11.5https://security.snyk.io/package/maven/io.jsonwebtoken%3Ajjwt-impl/0.11.5🌐 Web query:
jjwt library maintenance status current version💡 Result:
Sources: [1] GitHub releases, [2] Javadoc.io latest versions, [3] MVNRepository release info, [4] GitHub README.
Upgrade JJWT to 0.13.0 and use the official Bill of Materials approach.
Version 0.11.5 is outdated (0.13.0 released Aug 20, 2025) and has a CVE entry (CVE-2024-31033, though disputed by the vendor). Use the official BOM pattern for proper version alignment across JJWT modules:
Recommended: use jjwt-bom for version management
🤖 Prompt for AI Agents