Skip to content

Commit

Permalink
Merge pull request #219 from OutDecision/issue/216
Browse files Browse the repository at this point in the history
🐞 [BUGFIX]: 동시접속 에러 해결
  • Loading branch information
baeksom authored May 26, 2024
2 parents 136248c + 93c00d6 commit ee07b4b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package KGUcapstone.OutDecision.global.security.filter;

import KGUcapstone.OutDecision.domain.user.service.auth.TokenService;
import KGUcapstone.OutDecision.global.common.util.CookieUtil;
import KGUcapstone.OutDecision.global.common.util.JwtUtil;
import KGUcapstone.OutDecision.global.error.exception.ApiResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.FilterChain;
Expand All @@ -15,6 +18,8 @@

import java.io.IOException;

import static KGUcapstone.OutDecision.global.common.util.CookieUtil.deleteCookie;

@Slf4j
@RequiredArgsConstructor
@Component
Expand All @@ -33,6 +38,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
response.setCharacterEncoding("UTF-8");
objectMapper.writeValue(response.getWriter(), ApiResponse.onFailure("401",e.getMessage(),null));
deleteCookie(response, "Authorization");
}
}
}

0 comments on commit ee07b4b

Please sign in to comment.