diff --git a/backend/src/main/java/ru/micord/ervu/security/webbpm/jwt/JwtAuthenticationProvider.java b/backend/src/main/java/ru/micord/ervu/security/webbpm/jwt/JwtAuthenticationProvider.java index 122cd60..05fb495 100644 --- a/backend/src/main/java/ru/micord/ervu/security/webbpm/jwt/JwtAuthenticationProvider.java +++ b/backend/src/main/java/ru/micord/ervu/security/webbpm/jwt/JwtAuthenticationProvider.java @@ -53,8 +53,10 @@ public class JwtAuthenticationProvider implements AuthenticationProvider { HttpServletRequest request = (HttpServletRequest) requestAttributes.resolveReference( REFERENCE_REQUEST); String[] ids = token.getUserAccountId().split(":"); - if (request != null && (request.getRequestURI() - .endsWith("esia/logout") || ids.length == 2)) { + if (request == null) { + throw new IllegalStateException("No request found in request attributes"); + } + if (request.getRequestURI().endsWith("esia/logout") || ids.length == 2) { UsernamePasswordAuthenticationToken pwdToken = UsernamePasswordAuthenticationToken.authenticated(token.getUserAccountId(), null, Collections.emptyList()