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

[feat] 유저 로그인 과정 리펙토링 #591

Open
sohyundoh opened this issue Dec 13, 2024 · 0 comments
Open

[feat] 유저 로그인 과정 리펙토링 #591

sohyundoh opened this issue Dec 13, 2024 · 0 comments
Assignees
Labels

Comments

@sohyundoh
Copy link
Member

📌 Feature Issue

📝 To-do

    private LoginSuccessResponse getTokenDto(
            final UserInfoResponse userResponse
    ) {
        try {
            if (userService.isExistingUser(userResponse.socialId(), userResponse.socialType())) {
                Long userId = userService.getBySocialId(userResponse.socialId(), userResponse.socialType()).getId();
                return getTokenByUserId(userId, userService.getJoinedRoleFromUser(userId));
            } else {
                Long id = userService.createUser(userResponse.socialId(), userResponse.socialType(), userResponse.email());
                return getTokenByUserId(id, new HashMap<>());
            }
        } catch (DataIntegrityViolationException e) {
            Long userId = userService.getBySocialId(userResponse.socialId(), userResponse.socialType()).getId();
            return getTokenByUserId(userId, userService.getJoinedRoleFromUser(userId));
        }
    }

이 부분 너무 비효율적이라 리팩토링 진행하겠습니다~

@sohyundoh sohyundoh self-assigned this Dec 13, 2024
@sohyundoh sohyundoh added the high label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant