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..4a6c532b 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); @@ -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 ? "해당 이메일로 코드를 전송하겠습니다." : "해당 이메일로 가입된 회원 정보가 없습니다."; 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 {