Skip to content

Commit cb67c59

Browse files
feat(jwt): enhance jwt validation logging and public endpoint check (#151)
1 parent 08e5d8c commit cb67c59

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/iemr/common/identity/utils/JwtUserIdValidationFilter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
4343
return;
4444
}
4545
String path = request.getRequestURI();
46-
logger.info("JwtUserIdValidationFilter invoked for path: {}", path);
46+
String servletPath = request.getServletPath();
47+
logger.info("JwtUserIdValidationFilter invoked for requestURI: {}, servletPath: {}", path, servletPath);
4748

4849
// Skip JWT validation for public endpoints
49-
if (path.equals("/health") || path.equals("/version")) {
50+
if (servletPath.equals("/health") || servletPath.equals("/version") ||
51+
path.endsWith("/health") || path.endsWith("/version")) {
5052
logger.info("Public endpoint accessed: {} - skipping JWT validation", path);
5153
filterChain.doFilter(servletRequest, servletResponse);
5254
return;

0 commit comments

Comments
 (0)