From fa967e4c7e84d054ec3d1b008090fe4dd4593179 Mon Sep 17 00:00:00 2001 From: toychip Date: Tue, 3 Sep 2024 15:51:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20dojo=20=ED=8C=80=EC=9B=90=EC=9D=B4=20?= =?UTF-8?q?=EC=95=84=EB=8B=90=20=EA=B2=BD=EC=9A=B0=20=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/MemberAuthTokenAuthenticationProvider.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/src/main/kotlin/com/mashup/dojo/config/security/MemberAuthTokenAuthenticationProvider.kt b/api/src/main/kotlin/com/mashup/dojo/config/security/MemberAuthTokenAuthenticationProvider.kt index fbd7cd12..d6f1778f 100644 --- a/api/src/main/kotlin/com/mashup/dojo/config/security/MemberAuthTokenAuthenticationProvider.kt +++ b/api/src/main/kotlin/com/mashup/dojo/config/security/MemberAuthTokenAuthenticationProvider.kt @@ -17,8 +17,18 @@ class MemberAuthTokenAuthenticationProvider( val memberId = jwtTokenService.getMemberId(authToken) ?: throw DojoException.of(AUTHENTICATION_FAILURE, "invalid token") val member = memberService.findMemberById(memberId) ?: throw DojoException.of(MEMBER_NOT_FOUND) + notAllowMember(member.fullName) + return MemberPrincipal(member) } + + private fun notAllowMember(fullName: String) { + val dojo = listOf("한정민", "오예원", "박세원", "임준형", "이현재", "황태규", "최민석", "낭은영", "오시연") + + if (fullName !in dojo) { + throw DojoException.of(AUTHENTICATION_FAILURE, "You Are Not Dojo") + } + } } class MemberPrincipal(