From 0c49c2175c5ed38f3eb08b218280bd6ef50fcda8 Mon Sep 17 00:00:00 2001 From: Dongyoung Kim <145846246+goalSetter09@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:12:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85?= =?UTF-8?q?=EC=8B=9C=20CERTIFIED=5FMEMBER=EA=B0=80=20=EC=95=84=EB=8B=8C=20?= =?UTF-8?q?MEMBER=EB=A1=9C=20=EC=B4=88=EA=B8=B0=ED=99=94=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cotato/squadus/api/auth/dto/OAuth2Attribute.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/cotato/squadus/api/auth/dto/OAuth2Attribute.java b/src/main/java/com/cotato/squadus/api/auth/dto/OAuth2Attribute.java index d987566..9dcbee3 100644 --- a/src/main/java/com/cotato/squadus/api/auth/dto/OAuth2Attribute.java +++ b/src/main/java/com/cotato/squadus/api/auth/dto/OAuth2Attribute.java @@ -65,7 +65,7 @@ public Member toEntity(String uniqueId){ .username(username) .email(email) .uniqueId(uniqueId) - .memberRole(MemberRole.CERTIFIED_MEMBER.toString()) + .memberRole(MemberRole.MEMBER.toString()) .profileImage("default profile img") .university("uncertified") .build(); From 8c91dbf74a271b75674fe4e21e12ff8b8d988e0b Mon Sep 17 00:00:00 2001 From: Dongyoung Kim <145846246+goalSetter09@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:19:33 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=8B=9C=20memberRole=20=EC=9D=B8?= =?UTF-8?q?=EC=A6=9D=ED=9A=8C=EC=9B=90=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cotato/squadus/domain/auth/entity/Member.java | 5 +++++ .../cotato/squadus/domain/auth/service/EmailSendService.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cotato/squadus/domain/auth/entity/Member.java b/src/main/java/com/cotato/squadus/domain/auth/entity/Member.java index daf6ff2..e95d73c 100644 --- a/src/main/java/com/cotato/squadus/domain/auth/entity/Member.java +++ b/src/main/java/com/cotato/squadus/domain/auth/entity/Member.java @@ -76,4 +76,9 @@ public Member updateProfileImage(String profileImage) { this.profileImage = profileImage; return this; } + + public Member updateMemberRole(MemberRole memberRole) { + this.memberRole = memberRole; + return this; + } } diff --git a/src/main/java/com/cotato/squadus/domain/auth/service/EmailSendService.java b/src/main/java/com/cotato/squadus/domain/auth/service/EmailSendService.java index 5e2e679..27e1cf0 100644 --- a/src/main/java/com/cotato/squadus/domain/auth/service/EmailSendService.java +++ b/src/main/java/com/cotato/squadus/domain/auth/service/EmailSendService.java @@ -3,6 +3,7 @@ import com.cotato.squadus.common.config.RedisConfig; import com.cotato.squadus.common.config.auth.CustomOAuth2Member; import com.cotato.squadus.domain.auth.entity.Member; +import com.cotato.squadus.domain.auth.enums.MemberRole; import com.cotato.squadus.domain.auth.enums.SchoolDomain; import jakarta.mail.MessagingException; import jakarta.mail.internet.MimeMessage; @@ -99,13 +100,14 @@ public Boolean checkAuthNum(String email, String authNum, @AuthenticationPrincip // 회원의 university 필드를 업데이트 Member memberByUniqueId = memberService.findMemberByUniqueId(customOauth2Member.getUniqueId()); memberByUniqueId.updateUniversity(universityName); + memberByUniqueId.updateMemberRole(MemberRole.CERTIFIED_MEMBER); memberService.saveMember(memberByUniqueId); log.info("사용자 {}의 university 필드가 {}로 업데이트 되었습니다.", memberByUniqueId.getUsername(), universityName); + log.info("사용자 {}의 memberRole 필드가 {}로 업데이트 되었습니다.", memberByUniqueId.getUsername(), MemberRole.CERTIFIED_MEMBER); } return isAuthSuccessful; } - private boolean isValidSchoolEmail(String email) { if (email == null || !email.contains("@")) { return false;