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

[bug] 일반 로그인 오타 수정 #133

Closed
yonghwankim-dev opened this issue Jan 12, 2024 · 0 comments · Fixed by #134
Closed

[bug] 일반 로그인 오타 수정 #133

yonghwankim-dev opened this issue Jan 12, 2024 · 0 comments · Fixed by #134
Assignees
Labels
bug Something isn't working

Comments

@yonghwankim-dev
Copy link
Member

yonghwankim-dev commented Jan 12, 2024

상황

일반 로그인이 되지 않습니다.

원인

회원을 탐색할때 provider를 null로 전달합니다.

@Transactional(readOnly = true)
public LoginResponse login(LoginRequest request) {
	Member member = memberRepository.findMemberByEmailAndProvider(request.getEmail(), null)
		.orElseThrow(() -> new BadRequestException(MemberErrorCode.LOGIN_FAIL));
        // ...
}

해결방법

provider 매개변수에 "local"을 전달합니다.

@Transactional(readOnly = true)
public LoginResponse login(LoginRequest request) {
	Member member = memberRepository.findMemberByEmailAndProvider(request.getEmail(), LOCAL_PROVIDER)
		.orElseThrow(() -> new BadRequestException(MemberErrorCode.LOGIN_FAIL));
         // ...
	return LoginResponse.from(jwt, OauthMemberResponse.from(member));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant