Skip to content

Commit

Permalink
hotfix: 소셜 로그인 타입 요청 시 소문자 요청도 허용하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
TaeyeonRoyce committed Aug 10, 2024
1 parent 9460c26 commit 7403bb1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.celuveat.member.adapter.`in`.rest

import com.celuveat.member.domain.SocialLoginType
import org.springframework.core.convert.converter.Converter
import org.springframework.stereotype.Component

@Component
class SocialLoginTypeConverter : Converter<String, SocialLoginType> {
override fun convert(source: String): SocialLoginType {
return SocialLoginType.valueOf(source.uppercase())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.celuveat.member.adapter.`in`.rest.config

import com.celuveat.member.adapter.`in`.rest.SocialLoginTypeConverter
import org.springframework.context.annotation.Configuration
import org.springframework.format.FormatterRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
class SocialLoginConfiguration(
private val socialLoginTypeConverter: SocialLoginTypeConverter,
) : WebMvcConfigurer {
override fun addFormatters(registry: FormatterRegistry) {
registry.addConverter(socialLoginTypeConverter)
}
}

0 comments on commit 7403bb1

Please sign in to comment.