Skip to content

Commit

Permalink
Merge pull request #11 from wafflestudio21-5/feat/signup
Browse files Browse the repository at this point in the history
Feat : signup api 500 error 반환 수정
  • Loading branch information
lhw414 authored Jan 3, 2024
2 parents edd5b42 + 1e8a188 commit ea23dd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class JwtAuthenticationFilter(private val jwtTokenProvider: JwtTokenProvider) :
) {
val httpRequest = request as HttpServletRequest

if (isExcludedPath(httpRequest.pathInfo)) {
if (isExcludedPath("/" + httpRequest.requestURI.substringAfterLast("/"))) {
chain.doFilter(request, response)
return
}
Expand Down Expand Up @@ -48,6 +48,6 @@ class JwtAuthenticationFilter(private val jwtTokenProvider: JwtTokenProvider) :
}

private fun isExcludedPath(path: String): Boolean {
return path.startsWith("/api/signin") || path.startsWith("/api/signup") || path.startsWith("/test-page")
return path.startsWith("/signin") || path.startsWith("/signup") || path.startsWith("/test-page")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class JwtAuthenticationFilterTest {
@Test
fun `When path is excluded, filter should not check token`() {
// 토큰 검증 대상 path가 아닌 경우, filter가 token을 체크하지 않는지 확인
request.pathInfo = "/api/signin"
request.requestURI = "/api/signin"

jwtAuthenticationFilter.doFilter(request, response, filterChain)

Expand Down

0 comments on commit ea23dd1

Please sign in to comment.