From 3f0a7fa5c1056f48c2bf0d2302c613be5d4cfffa Mon Sep 17 00:00:00 2001 From: Eduard Tihomirov Date: Wed, 25 Dec 2024 12:46:10 +0300 Subject: [PATCH] SUPPORT-8755: Fix --- .../ervu/security/webbpm/jwt/JwtAuthenticationProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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()