SUPPORT-8571: Fix

This commit is contained in:
Eduard Tihomirov 2024-11-14 10:26:31 +03:00
parent 6ade6388b0
commit 7161cb4bbb

View file

@ -59,6 +59,10 @@ public class JwtAuthenticationFilter extends AbstractAuthenticationProcessingFil
}
try {
authentication = getAuthenticationManager().authenticate(authentication);
String browser = httpServletRequest.getHeader("User-Agent");
if (browser == null || !browser.contains("YaBrowser") || !browser.contains("Chromium GOST")) {
throw new CredentialsExpiredException("Invalid browser. Use YaBrowser or Chromium GOST");
}
if (!httpServletRequest.getRequestURI().endsWith("esia/logout")) {
Token token = jwtTokenService.getToken(tokenStr);
if (!token.getHasRole()) {