로그인 - MemberToken init 방식 수정

This commit is contained in:
Klaus 2023-08-04 21:51:46 +09:00
parent a009a728a8
commit 03d782850c
2 changed files with 3 additions and 3 deletions

View File

@ -61,6 +61,8 @@ class SecurityConfig(
.sessionManagement() .sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS) .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and() .and()
.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter::class.java)
.addFilterBefore(ExceptionHandlerFilter(objectMapper), JwtFilter::class.java)
.authorizeRequests() .authorizeRequests()
.antMatchers("/member/check/email").permitAll() .antMatchers("/member/check/email").permitAll()
.antMatchers("/member/check/nickname").permitAll() .antMatchers("/member/check/nickname").permitAll()
@ -71,8 +73,6 @@ class SecurityConfig(
.antMatchers("/stplat/privacy_policy").permitAll() .antMatchers("/stplat/privacy_policy").permitAll()
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()
.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter::class.java)
.addFilterBefore(ExceptionHandlerFilter(objectMapper), JwtFilter::class.java)
.build() .build()
} }
} }

View File

@ -66,7 +66,7 @@ class TokenProvider(
val lock = getOrCreateLock(memberId = memberId) val lock = getOrCreateLock(memberId = memberId)
lock.write { lock.write {
val memberToken = tokenRepository.findByIdOrNull(memberId) val memberToken = tokenRepository.findByIdOrNull(memberId)
?: MemberToken(id = memberId, listOf()) ?: MemberToken(id = memberId, tokenList = mutableListOf())
val memberTokenSet = memberToken.tokenList.toMutableSet() val memberTokenSet = memberToken.tokenList.toMutableSet()
memberTokenSet.add(token) memberTokenSet.add(token)