From 288dd3d6eec5bd2dde49aeac1cf72c22c21e5fd3 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 12:56:56 +0900 Subject: [PATCH 01/23] =?UTF-8?q?feat:=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=83=81=ED=83=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/domain/members/entity/enums/Role.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java b/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java index 671beb79..724243c7 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java @@ -1,5 +1,5 @@ package com.gachtaxi.domain.members.entity.enums; public enum Role { - MEMBER, ADMIN + TEMPORARY, MEMBER, ADMIN } From 781514348aba8ff2b808d174aee02492e8da882e Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 12:58:19 +0900 Subject: [PATCH 02/23] =?UTF-8?q?feat:=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=9D=B8=EA=B0=80=20=EA=B2=BD=EB=A1=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/global/config/PermitUrlConfig.java | 6 ++++++ .../java/com/gachtaxi/global/config/SecurityConfig.java | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java b/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java index 45ddfc07..f08823f3 100644 --- a/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java +++ b/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java @@ -16,6 +16,12 @@ public String[] getPublicUrl(){ }; } + public String[] getTmpMemberUrl(){ + return new String[]{ + "/api/tmp-members/**" + }; + } + public String[] getMemberUrl(){ return new String[]{ diff --git a/src/main/java/com/gachtaxi/global/config/SecurityConfig.java b/src/main/java/com/gachtaxi/global/config/SecurityConfig.java index cd5404a8..e7710684 100644 --- a/src/main/java/com/gachtaxi/global/config/SecurityConfig.java +++ b/src/main/java/com/gachtaxi/global/config/SecurityConfig.java @@ -1,7 +1,6 @@ package com.gachtaxi.global.config; -import com.gachtaxi.domain.members.entity.enums.Role; import com.gachtaxi.global.auth.jwt.authentication.CustomAccessDeniedHandler; import com.gachtaxi.global.auth.jwt.authentication.CustomAuthenticationEntryPoint; import com.gachtaxi.global.auth.jwt.filter.JwtAuthenticationFilter; @@ -24,6 +23,8 @@ import java.util.Arrays; import java.util.List; +import static com.gachtaxi.domain.members.entity.enums.Role.*; + @Configuration @EnableWebSecurity @RequiredArgsConstructor @@ -46,8 +47,9 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti http.authorizeHttpRequests((auth) -> auth .requestMatchers(permitUrlConfig.getPublicUrl()).permitAll() - .requestMatchers(permitUrlConfig.getMemberUrl()).hasRole(Role.MEMBER.name()) - .requestMatchers(permitUrlConfig.getAdminUrl()).hasRole(Role.ADMIN.name()) + .requestMatchers(permitUrlConfig.getTmpMemberUrl()).hasRole(TEMPORARY.name()) + .requestMatchers(permitUrlConfig.getMemberUrl()).hasAnyRole(MEMBER.name(), ADMIN.name()) + .requestMatchers(permitUrlConfig.getAdminUrl()).hasRole(ADMIN.name()) .anyRequest().authenticated()); http.exceptionHandling(e -> e From 93aead611dafde3f53b5b8feb66b2e895c5d39f8 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:33:45 +0900 Subject: [PATCH 03/23] =?UTF-8?q?feat:=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20tmpEmail=20?= =?UTF-8?q?=EC=A3=BC=EC=9E=85=20(UserDetails=20=EB=95=8C=EB=AC=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/members/entity/Members.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 174e46e0..47f30164 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -18,19 +18,19 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Members extends BaseEntity { - @Column(name = "email", nullable = false, unique = true) + @Column(name = "email", unique = true) private String email; @Column(name = "profile_picture") private String profilePicture; - @Column(name = "nickname", nullable = false) + @Column(name = "nickname") private String nickname; - @Column(name = "real_name", nullable = false) + @Column(name = "real_name") private String realName; - @Column(name = "student_number", nullable = false, unique = true) + @Column(name = "student_number", unique = true) private Long studentNumber; @Column(name = "phone_number", unique = true) // 피그마 참고, 일단 null 허용 @@ -49,22 +49,22 @@ public class Members extends BaseEntity { private Gender gender; // 이용 약관 동의 - @Column(name = "terms_agreement", nullable = false) + @Column(name = "terms_agreement") @ColumnDefault("true") private Boolean termsAgreement; // 개인정보 수집 동의 - @Column(name = "privacy_agreement", nullable = false) + @Column(name = "privacy_agreement") @ColumnDefault("true") private Boolean privacyAgreement; // 광고성 정보 수신 동의 - @Column(name = "marketing_agreement", nullable = false) + @Column(name = "marketing_agreement") @ColumnDefault("false") private Boolean marketingAgreement; // 2차 인증 (전화번호) - @Column(name = "two_factor_authentication", nullable = false) + @Column(name = "two_factor_authentication") @ColumnDefault("false") private Boolean twoFactorAuthentication; @@ -76,7 +76,7 @@ public class Members extends BaseEntity { * */ public static Members of(UserSignUpRequestDto dto){ - return Members.builder() + return com.gachtaxi.domain.members.entity.Members.builder() //.profilePicture(dto.profilePicture()) .email(dto.email()) .nickname(dto.nickName()) @@ -93,4 +93,12 @@ public static Members of(UserSignUpRequestDto dto){ .twoFactorAuthentication(dto.twoFactorAuthentication()) .build(); } + + public static Members ofKakaoId(Long kakaoId, String tmpEmail){ + return Members.builder() + .kakaoId(kakaoId) + .email(tmpEmail) + .role(Role.TEMPORARY) + .build(); + } } From 36c78066d679e0c966713abd96a37a5f77db5b97 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:35:07 +0900 Subject: [PATCH 04/23] =?UTF-8?q?fix:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EA=B5=AC=ED=98=84=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20(=ED=94=84=EB=A1=A0=ED=8A=B8?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=9D=B8=EA=B0=80=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=84=EB=8B=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gachtaxi/domain/members/controller/AuthController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java b/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java index c4c2fe21..2b4eecb0 100644 --- a/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java +++ b/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*; import static com.gachtaxi.domain.members.controller.ResponseMessage.*; +import static com.gachtaxi.global.auth.kakao.dto.KaKaoDTO.KakaoAuthCode; import static com.gachtaxi.global.auth.kakao.dto.KaKaoDTO.OauthKakaoResponse; @RequestMapping("/auth") @@ -22,9 +23,9 @@ public class AuthController { private final AuthService authService; private final JwtService jwtService; - @GetMapping("/login/kakao") - public ApiResponse kakaoLogin(@RequestParam("code") String authcode, HttpServletResponse response) { - OauthKakaoResponse res = authService.kakaoLogin(authcode, response); + @PostMapping("/login/kakao") + public ApiResponse kakaoLogin(@RequestBody KakaoAuthCode kakaoAuthCode, HttpServletResponse response) { + OauthKakaoResponse res = authService.kakaoLogin(kakaoAuthCode.authCode(), response); ResponseMessage OAUTH_STATUS = (res.status() == OauthLoginStatus.LOGIN) ? LOGIN_SUCCESS : UN_REGISTER; From ce5ede4fe7f321dee5d6d3e1754c42482b25a12a Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:35:42 +0900 Subject: [PATCH 05/23] =?UTF-8?q?feat:=20JwtProvider=20=EC=9E=84=EC=8B=9C?= =?UTF-8?q?=20=ED=86=A0=ED=81=B0=20=EC=83=9D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/auth/jwt/util/JwtProvider.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java b/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java index de78d4ef..89817fbd 100644 --- a/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java +++ b/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java @@ -18,6 +18,7 @@ public class JwtProvider { private static final String ID_CLAIM = "id"; private static final String EMAIL_CLAIM = "email"; private static final String ROLE_CLAIM = "role"; + private static final String TMP_EMAIL_CLAIM = "tmpEmail"; private final Key key; public JwtProvider(@Value("${gachtaxi.auth.jwt.key}") String secretKey) { @@ -27,6 +28,9 @@ public JwtProvider(@Value("${gachtaxi.auth.jwt.key}") String secretKey) { @Value("${gachtaxi.auth.jwt.accessTokenExpiration}") private Long accessTokenExpiration; + @Value("${gachtaxi.auth.jwt.tmpAccessTokenExpiration}") + private Long tmpAccessTokenExpiration; + @Value("${gachtaxi.auth.jwt.refreshTokenExpiration}") private Long refreshTokenExpiration; @@ -42,6 +46,19 @@ public String generateAccessToken(Long id, String email, String role) { .compact(); // 최종 문자열 생성 } + public String generateTmpAccessToken(Long id, String email, String role) { + return Jwts.builder() + .claim(ID_CLAIM, id) + .claim(EMAIL_CLAIM, email) + .claim(EMAIL_CLAIM, TMP_EMAIL_CLAIM) + .claim(ROLE_CLAIM, role) + .setSubject(ACCESS_TOKEN_SUBJECT) // 사용자 정보(고유 식별자) + .setIssuedAt(new Date()) // 발행 시간 + .setExpiration(new Date(System.currentTimeMillis() + tmpAccessTokenExpiration)) // 만료 시간 + .signWith(key, SignatureAlgorithm.HS256) // 서명 알고리즘 + .compact(); // 최종 문자열 생성 + } + public String generateRefreshToken(Long id, String email, String role) { return Jwts.builder() .claim(ID_CLAIM, id) From 197fcf5435838831ecded5fa19c5c78612ca723c Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:36:20 +0900 Subject: [PATCH 06/23] =?UTF-8?q?feat:=20JwtService=20=EC=9E=84=EC=8B=9C?= =?UTF-8?q?=20=ED=86=A0=ED=81=B0=20=EC=9D=91=EB=8B=B5=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gachtaxi/global/auth/jwt/service/JwtService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java b/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java index 2eab7b20..f7953430 100644 --- a/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java +++ b/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java @@ -1,5 +1,6 @@ package com.gachtaxi.global.auth.jwt.service; +import com.gachtaxi.domain.members.dto.request.TmpMemberDto; import com.gachtaxi.domain.members.entity.enums.Role; import com.gachtaxi.global.auth.jwt.dto.JwtTokenDto; import com.gachtaxi.global.auth.jwt.exception.CookieNotFoundException; @@ -36,6 +37,11 @@ public void responseJwtToken(Long userId, String email, Role role, HttpServletRe setCookie(jwtToken.refreshToken(), response); } + public void responseTmpAccessToken(TmpMemberDto tmpMemberDto, HttpServletResponse response) { + String tmpAccessToken = jwtProvider.generateTmpAccessToken(tmpMemberDto.userId(), tmpMemberDto.email(), tmpMemberDto.role().name()); + setHeader(tmpAccessToken, response); + } + public JwtTokenDto reissueJwtToken(HttpServletRequest request) { String refreshToken = extractRefreshToken(request); if(jwtExtractor.isExpired(refreshToken)){ From 5c1a8a1671136cf3aa0d000e5b5f0a065498a81f Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:36:40 +0900 Subject: [PATCH 07/23] =?UTF-8?q?feat:=20KakaoAuthCode=20Dto=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/global/auth/kakao/dto/KaKaoDTO.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/global/auth/kakao/dto/KaKaoDTO.java b/src/main/java/com/gachtaxi/global/auth/kakao/dto/KaKaoDTO.java index ea1d5916..38efd09b 100644 --- a/src/main/java/com/gachtaxi/global/auth/kakao/dto/KaKaoDTO.java +++ b/src/main/java/com/gachtaxi/global/auth/kakao/dto/KaKaoDTO.java @@ -1,10 +1,15 @@ package com.gachtaxi.global.auth.kakao.dto; import com.gachtaxi.global.auth.enums.OauthLoginStatus; +import jakarta.validation.constraints.NotBlank; import lombok.Builder; public class KaKaoDTO { + public record KakaoAuthCode( + @NotBlank String authCode + ){} + public record KakaoAccessToken( String access_token, String token_type, @@ -34,7 +39,6 @@ public record Profile( @Builder public record OauthKakaoResponse( Long userId, - Long kakaoId, OauthLoginStatus status ){} From 0e5d6a64525f47e4440a8d2c266ba78aacba64f0 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:37:38 +0900 Subject: [PATCH 08/23] =?UTF-8?q?feat:=20application-local,=20dev=20?= =?UTF-8?q?=EC=9E=84=EC=8B=9C=ED=86=A0=ED=81=B0=20=EB=A7=8C=EB=A3=8C?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 1 + src/main/resources/application-local.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 5ed8a053..05c01230 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -35,6 +35,7 @@ gachtaxi: key: ${JWT_SECRET_KEY} accessTokenExpiration: ${JWT_ACCESS_TOKEN_EXPIRATION} refreshTokenExpiration: ${JWT_REFRESH_TOKEN_EXPIRATION} + tmpAccessTokenExpiration: ${JWT_TMP_ACCESS_TOKEN_EXPIRATION} cookieMaxAge: ${JWT_COOKIE_MAX_AGE} secureOption: ${COOKIE_SECURE_OPTION} cookiePathOption: ${COOKIE_PATH_OPTION} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 02f0f136..d8889e93 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -35,6 +35,7 @@ gachtaxi: key: ${JWT_SECRET_KEY} accessTokenExpiration: ${JWT_ACCESS_TOKEN_EXPIRATION} refreshTokenExpiration: ${JWT_REFRESH_TOKEN_EXPIRATION} + tmpAccessTokenExpiration: ${JWT_TMP_ACCESS_TOKEN_EXPIRATION} cookieMaxAge: ${JWT_COOKIE_MAX_AGE} secureOption: ${COOKIE_SECURE_OPTION} cookiePathOption: ${COOKIE_PATH_OPTION} \ No newline at end of file From b6b2ea39fc9bb63a554aa25ddc0898d8db0b8da2 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:44:04 +0900 Subject: [PATCH 09/23] =?UTF-8?q?feat:=20=EC=9E=84=EC=8B=9C=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gachtaxi/domain/members/entity/Members.java | 8 ++++++-- .../gachtaxi/domain/members/service/MemberService.java | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 47f30164..1449caa7 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -18,6 +18,10 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Members extends BaseEntity { + // UserDetails를 만드는 과정에서 null 방지를 위해 임시로 저장하는 이메일 + // 추후 로직 개선하겠습니다. + private final static String TMP_EMAIL = "tmpEmail@gmail.com"; + @Column(name = "email", unique = true) private String email; @@ -94,10 +98,10 @@ public static Members of(UserSignUpRequestDto dto){ .build(); } - public static Members ofKakaoId(Long kakaoId, String tmpEmail){ + public static Members ofKakaoId(Long kakaoId){ return Members.builder() .kakaoId(kakaoId) - .email(tmpEmail) + .email(TMP_EMAIL) .role(Role.TEMPORARY) .build(); } diff --git a/src/main/java/com/gachtaxi/domain/members/service/MemberService.java b/src/main/java/com/gachtaxi/domain/members/service/MemberService.java index 5de2958c..87b48606 100644 --- a/src/main/java/com/gachtaxi/domain/members/service/MemberService.java +++ b/src/main/java/com/gachtaxi/domain/members/service/MemberService.java @@ -1,5 +1,6 @@ package com.gachtaxi.domain.members.service; +import com.gachtaxi.domain.members.dto.request.TmpMemberDto; import com.gachtaxi.domain.members.dto.request.UserSignUpRequestDto; import com.gachtaxi.domain.members.entity.Members; import com.gachtaxi.domain.members.exception.DuplicatedStudentNumberException; @@ -19,6 +20,7 @@ public class MemberService { private final JwtService jwtService; private final MemberRepository memberRepository; + //TODO 최종 회원가입 절차에서 사용 @Transactional public void saveMember(UserSignUpRequestDto dto, HttpServletResponse response) { checkDuplicatedStudentNumber(dto); @@ -27,6 +29,14 @@ public void saveMember(UserSignUpRequestDto dto, HttpServletResponse response) { jwtService.responseJwtToken(newMember.getId(), newMember.getEmail(), newMember.getRole(), response); } + // 임시 유저 저장 + @Transactional + public TmpMemberDto saveTmpMember(Long kakaoId){ + Members tmpMember = Members.ofKakaoId(kakaoId); + memberRepository.save(tmpMember); + return TmpMemberDto.of(tmpMember); + } + public Optional findByKakaoId(Long kakaoId) { return memberRepository.findByKakaoId(kakaoId); } From 7dc49bfbef2aa74ef79973f223ff93d41636a3df Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:45:00 +0900 Subject: [PATCH 10/23] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EC=A0=88=EC=B0=A8=20=EC=A4=91=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EB=B0=9C=EC=83=9D=EC=8B=9C=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=EB=8A=94=20=EC=83=9D=EA=B2=A8=EB=82=98=EB=AF=80?= =?UTF-8?q?=EB=A1=9C=20=EC=A1=B0=EA=B1=B4=EC=97=90=20TEMPORARY=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gachtaxi/domain/members/service/AuthService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java index 9c29c261..501ac7d1 100644 --- a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java +++ b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java @@ -1,5 +1,6 @@ package com.gachtaxi.domain.members.service; +import com.gachtaxi.domain.members.dto.request.TmpMemberDto; import com.gachtaxi.domain.members.entity.Members; import com.gachtaxi.global.auth.jwt.service.JwtService; import com.gachtaxi.global.auth.kakao.util.KakaoUtil; @@ -7,8 +8,10 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; + import java.util.Optional; +import static com.gachtaxi.domain.members.entity.enums.Role.TEMPORARY; import static com.gachtaxi.global.auth.kakao.dto.KaKaoDTO.*; @@ -33,12 +36,15 @@ public OauthKakaoResponse kakaoLogin(String authCode, HttpServletResponse respon Long kakaoId = userInfo.id(); Optional optionalMember = memberService.findByKakaoId(kakaoId); - if(optionalMember.isEmpty()) { - return oauthMapper.toKakaoUnRegisterResponse(userInfo); + if(optionalMember.isEmpty() || optionalMember.get().getRole() == TEMPORARY) { + TmpMemberDto tmpDto = memberService.saveTmpMember(kakaoId); + + jwtService.responseTmpAccessToken(tmpDto, response); + return oauthMapper.toKakaoUnRegisterResponse(tmpDto.userId()); } Members member = optionalMember.get(); jwtService.responseJwtToken(member.getId(), member.getEmail(), member.getRole(), response); - return oauthMapper.toKakaoLoginResponse(userInfo, member.getId()); + return oauthMapper.toKakaoLoginResponse(member.getId()); } } From 5816cdbb8badcecbd8a1ef2045688b6ca1b82692 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:46:43 +0900 Subject: [PATCH 11/23] =?UTF-8?q?feat:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=B5=9C=EC=A2=85=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=20-=20userId=EC=99=80=20=ED=97=A4=EB=8D=94=EC=97=90?= =?UTF-8?q?=20Token=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/global/auth/mapper/OauthMapper.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gachtaxi/global/auth/mapper/OauthMapper.java b/src/main/java/com/gachtaxi/global/auth/mapper/OauthMapper.java index 94597c3b..73c8cd4a 100644 --- a/src/main/java/com/gachtaxi/global/auth/mapper/OauthMapper.java +++ b/src/main/java/com/gachtaxi/global/auth/mapper/OauthMapper.java @@ -8,18 +8,17 @@ @Component public class OauthMapper { - public OauthKakaoResponse toKakaoUnRegisterResponse(KakaoUserInfoResponse userInfo) { + public OauthKakaoResponse toKakaoUnRegisterResponse(Long userId) { return OauthKakaoResponse.builder() - .kakaoId(userInfo.id()) + .userId(userId) .status(UN_REGISTER) .build(); } // jwt 토큰 추가 할 것. - public OauthKakaoResponse toKakaoLoginResponse(KakaoUserInfoResponse userInfo, Long userId) { + public OauthKakaoResponse toKakaoLoginResponse(Long userId) { return OauthKakaoResponse.builder() .userId(userId) - .kakaoId(userInfo.id()) .status(LOGIN) .build(); } From 983b10cda3a0b87beed3041d127d71112e9a278f Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 13:54:33 +0900 Subject: [PATCH 12/23] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EC=A7=84=ED=96=89=EC=9D=B4=20=EC=A4=91=EB=8B=A8?= =?UTF-8?q?=EB=90=9C=20=EC=9C=A0=EC=A0=80=20=EC=97=A3=EC=A7=80=20=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gachtaxi/domain/members/service/AuthService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java index 501ac7d1..76daa3cc 100644 --- a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java +++ b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java @@ -35,14 +35,22 @@ public OauthKakaoResponse kakaoLogin(String authCode, HttpServletResponse respon Long kakaoId = userInfo.id(); Optional optionalMember = memberService.findByKakaoId(kakaoId); +// System.out.println(optionalMember.get().getKakaoId()); - if(optionalMember.isEmpty() || optionalMember.get().getRole() == TEMPORARY) { + if(optionalMember.isEmpty()) { TmpMemberDto tmpDto = memberService.saveTmpMember(kakaoId); jwtService.responseTmpAccessToken(tmpDto, response); return oauthMapper.toKakaoUnRegisterResponse(tmpDto.userId()); } + // 회원 가입 진행 중 중단된 유저 또한 다시 임시 토큰을 재발급해준다. + if(optionalMember.get().getRole() == TEMPORARY){ + TmpMemberDto tmpDto = TmpMemberDto.of(optionalMember.get()); + jwtService.responseTmpAccessToken(tmpDto, response); + return oauthMapper.toKakaoUnRegisterResponse(tmpDto.userId()); + } + Members member = optionalMember.get(); jwtService.responseJwtToken(member.getId(), member.getEmail(), member.getRole(), response); return oauthMapper.toKakaoLoginResponse(member.getId()); From 2038155aebba8da8b1fb18e6529e60690cef2f6b Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 14:10:33 +0900 Subject: [PATCH 13/23] =?UTF-8?q?feat:=20TmpMemberDto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../members/dto/request/TmpMemberDto.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/com/gachtaxi/domain/members/dto/request/TmpMemberDto.java diff --git a/src/main/java/com/gachtaxi/domain/members/dto/request/TmpMemberDto.java b/src/main/java/com/gachtaxi/domain/members/dto/request/TmpMemberDto.java new file mode 100644 index 00000000..4b4436c4 --- /dev/null +++ b/src/main/java/com/gachtaxi/domain/members/dto/request/TmpMemberDto.java @@ -0,0 +1,20 @@ +package com.gachtaxi.domain.members.dto.request; + +import com.gachtaxi.domain.members.entity.Members; +import com.gachtaxi.domain.members.entity.enums.Role; +import lombok.Builder; + +@Builder +public record TmpMemberDto( + Long userId, + String email, + Role role +) { + public static TmpMemberDto of(Members tmpMember) { + return TmpMemberDto.builder() + .userId(tmpMember.getId()) + .email(tmpMember.getEmail()) + .role(tmpMember.getRole()) + .build(); + } +} From a3d2e44c840bda6f87328b0539d751bd03178fba Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 14:51:59 +0900 Subject: [PATCH 14/23] =?UTF-8?q?feat:=20@Valid=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gachtaxi/domain/members/controller/AuthController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java b/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java index 2b4eecb0..76763de6 100644 --- a/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java +++ b/src/main/java/com/gachtaxi/domain/members/controller/AuthController.java @@ -7,6 +7,7 @@ import com.gachtaxi.global.common.response.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -24,7 +25,7 @@ public class AuthController { private final JwtService jwtService; @PostMapping("/login/kakao") - public ApiResponse kakaoLogin(@RequestBody KakaoAuthCode kakaoAuthCode, HttpServletResponse response) { + public ApiResponse kakaoLogin(@RequestBody @Valid KakaoAuthCode kakaoAuthCode, HttpServletResponse response) { OauthKakaoResponse res = authService.kakaoLogin(kakaoAuthCode.authCode(), response); ResponseMessage OAUTH_STATUS = (res.status() == OauthLoginStatus.LOGIN) ? LOGIN_SUCCESS From c168c7aa51c479b66b0603e5cc80941ef4ef0e23 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 14:52:54 +0900 Subject: [PATCH 15/23] =?UTF-8?q?feat:=20Members=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gachtaxi/domain/members/entity/Members.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 1449caa7..6accb5a2 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -80,7 +80,7 @@ public class Members extends BaseEntity { * */ public static Members of(UserSignUpRequestDto dto){ - return com.gachtaxi.domain.members.entity.Members.builder() + return Members.builder() //.profilePicture(dto.profilePicture()) .email(dto.email()) .nickname(dto.nickName()) From 3818a468a80a16e16a2f0879cdee46e1e3c8c72e Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 14:58:12 +0900 Subject: [PATCH 16/23] =?UTF-8?q?remove:=20=EC=B6=9C=EB=A0=A5=EB=AC=B8=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/domain/members/service/AuthService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java index 76daa3cc..042fdbda 100644 --- a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java +++ b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java @@ -35,7 +35,6 @@ public OauthKakaoResponse kakaoLogin(String authCode, HttpServletResponse respon Long kakaoId = userInfo.id(); Optional optionalMember = memberService.findByKakaoId(kakaoId); -// System.out.println(optionalMember.get().getKakaoId()); if(optionalMember.isEmpty()) { TmpMemberDto tmpDto = memberService.saveTmpMember(kakaoId); From 9deb9f9cafbf99d317592f6ac3ff2bd63ca3bfe5 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 15:55:04 +0900 Subject: [PATCH 17/23] =?UTF-8?q?fix:=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EA=B6=8C=ED=95=9C=20=EA=B2=BD=EB=A1=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gachtaxi/global/config/SecurityConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/global/config/SecurityConfig.java b/src/main/java/com/gachtaxi/global/config/SecurityConfig.java index e7710684..ddaf21c4 100644 --- a/src/main/java/com/gachtaxi/global/config/SecurityConfig.java +++ b/src/main/java/com/gachtaxi/global/config/SecurityConfig.java @@ -47,7 +47,6 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti http.authorizeHttpRequests((auth) -> auth .requestMatchers(permitUrlConfig.getPublicUrl()).permitAll() - .requestMatchers(permitUrlConfig.getTmpMemberUrl()).hasRole(TEMPORARY.name()) .requestMatchers(permitUrlConfig.getMemberUrl()).hasAnyRole(MEMBER.name(), ADMIN.name()) .requestMatchers(permitUrlConfig.getAdminUrl()).hasRole(ADMIN.name()) .anyRequest().authenticated()); From 0fdc43dc4365dc9343801de1554643cd2f6266a2 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:10:17 +0900 Subject: [PATCH 18/23] =?UTF-8?q?fix:=20=ED=86=A0=ED=81=B0=20email=20Claim?= =?UTF-8?q?s=EC=97=90=EB=8A=94=20=EB=8D=94=EB=AF=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/auth/jwt/service/JwtService.java | 2 +- .../gachtaxi/global/auth/jwt/util/JwtProvider.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java b/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java index f7953430..cf9c221d 100644 --- a/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java +++ b/src/main/java/com/gachtaxi/global/auth/jwt/service/JwtService.java @@ -38,7 +38,7 @@ public void responseJwtToken(Long userId, String email, Role role, HttpServletRe } public void responseTmpAccessToken(TmpMemberDto tmpMemberDto, HttpServletResponse response) { - String tmpAccessToken = jwtProvider.generateTmpAccessToken(tmpMemberDto.userId(), tmpMemberDto.email(), tmpMemberDto.role().name()); + String tmpAccessToken = jwtProvider.generateTmpAccessToken(tmpMemberDto.userId(), tmpMemberDto.role().name()); setHeader(tmpAccessToken, response); } diff --git a/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java b/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java index 89817fbd..a31756e6 100644 --- a/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java +++ b/src/main/java/com/gachtaxi/global/auth/jwt/util/JwtProvider.java @@ -18,7 +18,8 @@ public class JwtProvider { private static final String ID_CLAIM = "id"; private static final String EMAIL_CLAIM = "email"; private static final String ROLE_CLAIM = "role"; - private static final String TMP_EMAIL_CLAIM = "tmpEmail"; + private static final String ROLE_PREFIX = "ROLE_"; + private static final String DUMMY_EMAIL = "dummy_email"; private final Key key; public JwtProvider(@Value("${gachtaxi.auth.jwt.key}") String secretKey) { @@ -38,7 +39,7 @@ public String generateAccessToken(Long id, String email, String role) { return Jwts.builder() .claim(ID_CLAIM, id) .claim(EMAIL_CLAIM, email) - .claim(ROLE_CLAIM, role) + .claim(ROLE_CLAIM, ROLE_PREFIX+role) .setSubject(ACCESS_TOKEN_SUBJECT) // 사용자 정보(고유 식별자) .setIssuedAt(new Date()) // 발행 시간 .setExpiration(new Date(System.currentTimeMillis() + accessTokenExpiration)) // 만료 시간 @@ -46,12 +47,11 @@ public String generateAccessToken(Long id, String email, String role) { .compact(); // 최종 문자열 생성 } - public String generateTmpAccessToken(Long id, String email, String role) { + public String generateTmpAccessToken(Long id, String role) { return Jwts.builder() .claim(ID_CLAIM, id) - .claim(EMAIL_CLAIM, email) - .claim(EMAIL_CLAIM, TMP_EMAIL_CLAIM) - .claim(ROLE_CLAIM, role) + .claim(EMAIL_CLAIM, DUMMY_EMAIL) + .claim(ROLE_CLAIM, ROLE_PREFIX+role) .setSubject(ACCESS_TOKEN_SUBJECT) // 사용자 정보(고유 식별자) .setIssuedAt(new Date()) // 발행 시간 .setExpiration(new Date(System.currentTimeMillis() + tmpAccessTokenExpiration)) // 만료 시간 @@ -63,7 +63,7 @@ public String generateRefreshToken(Long id, String email, String role) { return Jwts.builder() .claim(ID_CLAIM, id) .claim(EMAIL_CLAIM, email) - .claim(ROLE_CLAIM, role) + .claim(ROLE_CLAIM, ROLE_PREFIX+role) .setSubject(REFRESH_TOKEN_SUBJECT) // 사용자 정보(고유 식별자) .setIssuedAt(new Date()) // 발행 시간 .setExpiration(new Date(System.currentTimeMillis() + refreshTokenExpiration)) // 만료 시간 From dbaa479bf24aa3d38d27a6071bb88ebdfcd42c82 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:10:52 +0900 Subject: [PATCH 19/23] =?UTF-8?q?fix:=20=EC=9E=84=EC=8B=9C=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20email=20DB=EC=97=90=EB=8A=94=20null=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gachtaxi/domain/members/entity/Members.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 6accb5a2..09434d99 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -101,7 +101,6 @@ public static Members of(UserSignUpRequestDto dto){ public static Members ofKakaoId(Long kakaoId){ return Members.builder() .kakaoId(kakaoId) - .email(TMP_EMAIL) .role(Role.TEMPORARY) .build(); } From 863cd2af422ea4adae77af0a79547c2fd6802142 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:17:28 +0900 Subject: [PATCH 20/23] =?UTF-8?q?feat:=20UserStatus=20-=20ACTIVE,=20INACTI?= =?UTF-8?q?VE=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/domain/members/entity/Members.java | 8 +++++++- .../com/gachtaxi/domain/members/entity/enums/Role.java | 2 +- .../com/gachtaxi/domain/members/service/AuthService.java | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 09434d99..486e5008 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -3,6 +3,7 @@ import com.gachtaxi.domain.members.dto.request.UserSignUpRequestDto; import com.gachtaxi.domain.members.entity.enums.Gender; import com.gachtaxi.domain.members.entity.enums.Role; +import com.gachtaxi.domain.members.entity.enums.UserStatus; import com.gachtaxi.global.common.entity.BaseEntity; import jakarta.persistence.*; import lombok.AccessLevel; @@ -52,6 +53,9 @@ public class Members extends BaseEntity { @Enumerated(EnumType.STRING) private Gender gender; + @Enumerated(EnumType.STRING) + private UserStatus status; + // 이용 약관 동의 @Column(name = "terms_agreement") @ColumnDefault("true") @@ -90,6 +94,7 @@ public static Members of(UserSignUpRequestDto dto){ .kakaoId(dto.kakaoId()) .googleId(dto.googleId()) .role(Role.MEMBER) + .status(UserStatus.ACTIVE) .gender(dto.gender()) .termsAgreement(dto.termsAgreement()) .privacyAgreement(dto.privacyAgreement()) @@ -101,7 +106,8 @@ public static Members of(UserSignUpRequestDto dto){ public static Members ofKakaoId(Long kakaoId){ return Members.builder() .kakaoId(kakaoId) - .role(Role.TEMPORARY) + .status(UserStatus.INACTIVE) + .role(Role.MEMBER) .build(); } } diff --git a/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java b/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java index 724243c7..671beb79 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/enums/Role.java @@ -1,5 +1,5 @@ package com.gachtaxi.domain.members.entity.enums; public enum Role { - TEMPORARY, MEMBER, ADMIN + MEMBER, ADMIN } diff --git a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java index 042fdbda..83989dee 100644 --- a/src/main/java/com/gachtaxi/domain/members/service/AuthService.java +++ b/src/main/java/com/gachtaxi/domain/members/service/AuthService.java @@ -11,7 +11,7 @@ import java.util.Optional; -import static com.gachtaxi.domain.members.entity.enums.Role.TEMPORARY; +import static com.gachtaxi.domain.members.entity.enums.UserStatus.INACTIVE; import static com.gachtaxi.global.auth.kakao.dto.KaKaoDTO.*; @@ -44,7 +44,7 @@ public OauthKakaoResponse kakaoLogin(String authCode, HttpServletResponse respon } // 회원 가입 진행 중 중단된 유저 또한 다시 임시 토큰을 재발급해준다. - if(optionalMember.get().getRole() == TEMPORARY){ + if(optionalMember.get().getStatus() == INACTIVE){ TmpMemberDto tmpDto = TmpMemberDto.of(optionalMember.get()); jwtService.responseTmpAccessToken(tmpDto, response); return oauthMapper.toKakaoUnRegisterResponse(tmpDto.userId()); From d6f4cad3caed63ee33619addaf635e30120b1471 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:24:28 +0900 Subject: [PATCH 21/23] =?UTF-8?q?remove:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=83=81=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gachtaxi/domain/members/entity/Members.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/com/gachtaxi/domain/members/entity/Members.java b/src/main/java/com/gachtaxi/domain/members/entity/Members.java index 486e5008..a64e8db2 100644 --- a/src/main/java/com/gachtaxi/domain/members/entity/Members.java +++ b/src/main/java/com/gachtaxi/domain/members/entity/Members.java @@ -19,10 +19,6 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Members extends BaseEntity { - // UserDetails를 만드는 과정에서 null 방지를 위해 임시로 저장하는 이메일 - // 추후 로직 개선하겠습니다. - private final static String TMP_EMAIL = "tmpEmail@gmail.com"; - @Column(name = "email", unique = true) private String email; From feca89dc2f2eeae95c12f0dacad252590d65ad7c Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:28:24 +0900 Subject: [PATCH 22/23] =?UTF-8?q?feat:=20UserStatus=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gachtaxi/domain/members/entity/enums/UserStatus.java | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/main/java/com/gachtaxi/domain/members/entity/enums/UserStatus.java diff --git a/src/main/java/com/gachtaxi/domain/members/entity/enums/UserStatus.java b/src/main/java/com/gachtaxi/domain/members/entity/enums/UserStatus.java new file mode 100644 index 00000000..306e5999 --- /dev/null +++ b/src/main/java/com/gachtaxi/domain/members/entity/enums/UserStatus.java @@ -0,0 +1,5 @@ +package com.gachtaxi.domain.members.entity.enums; + +public enum UserStatus { + ACTIVE, INACTIVE +} From 650522cea07efa4f0615b080c58d39d0ec0a96d2 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 8 Jan 2025 16:48:55 +0900 Subject: [PATCH 23/23] =?UTF-8?q?remove:=20=EC=9E=84=EC=8B=9C=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EA=B6=8C=ED=95=9C=20=EA=B2=BD=EB=A1=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gachtaxi/global/config/PermitUrlConfig.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java b/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java index f08823f3..45ddfc07 100644 --- a/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java +++ b/src/main/java/com/gachtaxi/global/config/PermitUrlConfig.java @@ -16,12 +16,6 @@ public String[] getPublicUrl(){ }; } - public String[] getTmpMemberUrl(){ - return new String[]{ - "/api/tmp-members/**" - }; - } - public String[] getMemberUrl(){ return new String[]{