Skip to content

Commit

Permalink
fix: 닉네임 정보가 있더라도 이메일이 없으면 회원가입이 완료되지 않는 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
uijin-j committed Mar 18, 2024
1 parent 91bfc78 commit fcc1110
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sidepeek_backend_secret
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class AuthProvider extends BaseTimeEntity {

public static final Boolean DEFAULT_IS_REGISTRATION_COMPLETE = false;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
Expand All @@ -45,16 +43,11 @@ public class AuthProvider extends BaseTimeEntity {
@Column(name = "provider_id", length = MAX_PROVIDER_ID_LENGTH)
private String providerId;

@Column(name = "is_registration_complete", nullable = false, columnDefinition = "TINYINT")
private boolean isRegistrationComplete = DEFAULT_IS_REGISTRATION_COMPLETE;

@Builder
private AuthProvider(User user, ProviderType providerType, String providerId,
Boolean isRegistrationComplete) {
private AuthProvider(User user, ProviderType providerType, String providerId) {
this.user = user;
this.providerType = providerType;
this.providerId = providerId;
this.isRegistrationComplete = isRegistrationComplete;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public record SocialLoginResponse(
String refreshToken,
@Schema(description = "소셜 로그인 타입", example = "GITHUB")
ProviderType providerType,
@Schema(description = "회원가입 완료 여부", example = "true")
boolean isRegistrationComplete,
@Schema(description = "로그인 사용자 정보")
UserSummary user
) {
Expand All @@ -26,7 +24,6 @@ public static SocialLoginResponse of(LoginResponse loginResponse, AuthProvider a
.accessToken(loginResponse.accessToken())
.refreshToken(loginResponse.refreshToken())
.providerType(authProvider.getProviderType())
.isRegistrationComplete(authProvider.isRegistrationComplete())
.user(loginResponse.user())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private AuthProvider createAuthProvider(Map<String, Object> attributes,
.providerType(providerType)
.providerId(providerId)
.user(user)
.isRegistrationComplete(user.getEmail() != null && user.getNickname() != null)
.build();

return authProviderRepository.save(authProvider);
Expand Down

0 comments on commit fcc1110

Please sign in to comment.