Skip to content
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

Fix that was bug of signup when registering as a member using a different path with the same email account #110

Open
phjppo0918 opened this issue Oct 5, 2021 · 0 comments

Comments

@phjppo0918
Copy link
Member

phjppo0918 commented Oct 5, 2021

image
image

51번 경우 동일한 Email 계정으로 naver, kakao 로그인 시 새로 생성되지 않고 덧붙이는 현상 발생.

config/auth/CustomOAuth2UserService.java

private Member saveOrUpdate(OAuthAttributes attributes) {
        Member member = memberRepository.findByEmail(attributes.getEmail())
                .map(entity -> entity.update(attributes.getName(),attributes.getPicture()))
                .orElse(attributes.toEntity());

        return memberRepository.save(member);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants