From 6b1c1303eb3a325296a0ac21ca0c2da2fa549b9b Mon Sep 17 00:00:00 2001 From: Heidi Date: Wed, 7 Aug 2024 23:44:38 +0900 Subject: [PATCH] =?UTF-8?q?fix;=20=EC=9D=B8=EC=A6=9D=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=20=EB=8B=A4=EC=8B=9C=20=EB=84=A3=EC=96=B4=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/WebSecurityConfiguration.kt | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/api/src/main/kotlin/com/mashup/dojo/config/security/WebSecurityConfiguration.kt b/api/src/main/kotlin/com/mashup/dojo/config/security/WebSecurityConfiguration.kt index 07262616..61f40a5b 100644 --- a/api/src/main/kotlin/com/mashup/dojo/config/security/WebSecurityConfiguration.kt +++ b/api/src/main/kotlin/com/mashup/dojo/config/security/WebSecurityConfiguration.kt @@ -1,5 +1,7 @@ package com.mashup.dojo.config.security +import com.mashup.dojo.service.MemberService +import org.springframework.boot.web.servlet.FilterRegistrationBean import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -8,16 +10,15 @@ class WebSecurityConfiguration { @Bean fun jwtTokenService() = JwtTokenService("dojo-secret-dojo-secret-dojo-secret") - // 임시 제거 -// @Bean -// fun tokenBasedAuthenticationFilter( -// memberService: MemberService, -// jwtTokenService: JwtTokenService, -// ): FilterRegistrationBean { -// val authenticationProvider = MemberAuthTokenAuthenticationProvider(jwtTokenService, memberService) -// -// val filter = MemberAuthTokenAuthenticationFilter(authenticationProvider) -// -// return FilterRegistrationBean(filter).apply {} -// } + @Bean + fun tokenBasedAuthenticationFilter( + memberService: MemberService, + jwtTokenService: JwtTokenService, + ): FilterRegistrationBean { + val authenticationProvider = MemberAuthTokenAuthenticationProvider(jwtTokenService, memberService) + + val filter = MemberAuthTokenAuthenticationFilter(authenticationProvider) + + return FilterRegistrationBean(filter).apply {} + } }