From 26de966e9c5ee1a3564cef1648b11c601dc58b39 Mon Sep 17 00:00:00 2001 From: Goathoon Date: Wed, 11 Oct 2023 16:52:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20non=20social=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=EA=B0=80=EC=9E=85=ED=9B=84=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EC=8B=9C=20=EC=9C=A0=ED=9A=A8=ED=95=9C=20authentication=20?= =?UTF-8?q?=EA=B0=9D=EC=B2=B4=EB=A1=9C=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inforum/domain/member/service/MemberService.java | 2 +- .../Inforum/domain/mypage/repository/MyRepository.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java b/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java index 09f26380..ed10e3c5 100644 --- a/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java +++ b/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java @@ -72,7 +72,7 @@ public SaveMemberResponseDto requestMemberRegistration (MemberSaveDto memberSave NonSocialMember member = NonSocialMember.createNonSocialMember(memberSaveDto); SaveMemberResponseDto savedMember = memberRepository.save(member); - UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(memberSaveDto.getUserEmail(), memberSaveDto.getUserPw()); + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(savedMember.getId(), memberSaveDto.getUserPw()); SecurityContextHolder.getContext().setAuthentication(authentication); makeLoginForSavedUser(request, response, authentication); diff --git a/src/main/java/Funssion/Inforum/domain/mypage/repository/MyRepository.java b/src/main/java/Funssion/Inforum/domain/mypage/repository/MyRepository.java index 827c7e67..464b3e9f 100644 --- a/src/main/java/Funssion/Inforum/domain/mypage/repository/MyRepository.java +++ b/src/main/java/Funssion/Inforum/domain/mypage/repository/MyRepository.java @@ -3,16 +3,11 @@ import Funssion.Inforum.common.constant.PostType; import Funssion.Inforum.common.constant.Sign; -import Funssion.Inforum.domain.mypage.domain.History; - import Funssion.Inforum.domain.member.dto.response.IsProfileSavedDto; import Funssion.Inforum.domain.member.entity.MemberProfileEntity; -import Funssion.Inforum.domain.post.memo.domain.Memo; -import org.springframework.cglib.core.Local; +import Funssion.Inforum.domain.mypage.domain.History; -import java.sql.Date; import java.time.LocalDate; -import java.time.LocalDateTime; import java.util.List; public interface MyRepository { From 79d51023d0b4d33cbf4810c6d6c4ed2552e9fabf Mon Sep 17 00:00:00 2001 From: Goathoon Date: Wed, 11 Oct 2023 18:03:29 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=97=AC=EB=B6=80=20=ED=99=95=EC=9D=B8=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Funssion/Inforum/domain/member/service/MemberService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java b/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java index ed10e3c5..4a6c532b 100644 --- a/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java +++ b/src/main/java/Funssion/Inforum/domain/member/service/MemberService.java @@ -138,6 +138,9 @@ public ValidatedDto isValidEmail(String email){ return new ValidatedDto(isEmailAvailable,message); } public ValidatedDto isRegisteredEmail(String email){ + if(memberRepository.findSocialMemberByEmail(email).isPresent()){ + return new ValidatedDto(false,"구글 로그인으로 등록된 계정입니다."); + } boolean isEmailRegistered = memberRepository.findNonSocialMemberByEmail(email).isPresent(); String message = isEmailRegistered ? "해당 이메일로 코드를 전송하겠습니다." : "해당 이메일로 가입된 회원 정보가 없습니다.";