SUPPORT-9605: убрал создание токена с finally

This commit is contained in:
adel.ka 2025-11-28 14:20:59 +03:00
parent 89b88fc64d
commit 3ea1e01a1a

View file

@ -280,7 +280,7 @@ public class EsiaAuthService {
Thread.currentThread().getId(), timeSignSecret, timeRequestAccessToken, timeVerifySecret); Thread.currentThread().getId(), timeSignSecret, timeRequestAccessToken, timeVerifySecret);
} }
OrgInfo orgInfo = null; OrgInfo orgInfo = null;
String status = null, ervuId = null; String status = null;
try { try {
orgInfo = getOrgInfo(esiaAccessTokenStr); orgInfo = getOrgInfo(esiaAccessTokenStr);
hasRole = ulDataService.checkRole(esiaAccessTokenStr); hasRole = ulDataService.checkRole(esiaAccessTokenStr);
@ -289,8 +289,9 @@ public class EsiaAuthService {
LOGGER.error("The user with id = " + prnOid + " does not have the required role"); LOGGER.error("The user with id = " + prnOid + " does not have the required role");
throw new LocalizedException("access_denied", MESSAGE_SOURCE); throw new LocalizedException("access_denied", MESSAGE_SOURCE);
} }
ervuId = getErvuId(prnOid, orgInfo); String ervuId = getErvuId(prnOid, orgInfo);
status = AuditConstants.SUCCESS_STATUS_TYPE; status = AuditConstants.SUCCESS_STATUS_TYPE;
createTokenAndAddCookie(response, prnOid, ervuId, hasRole, fileUploadAllowed, expiresIn);
} }
catch (JsonProcessingException e) { catch (JsonProcessingException e) {
throw new EsiaException(e); throw new EsiaException(e);
@ -303,7 +304,6 @@ public class EsiaAuthService {
auditService.processAuthEvent(request, orgInfo, prnOid, status, auditService.processAuthEvent(request, orgInfo, prnOid, status,
AuditConstants.LOGIN_EVENT_TYPE); AuditConstants.LOGIN_EVENT_TYPE);
} }
createTokenAndAddCookie(response, prnOid, ervuId, hasRole, fileUploadAllowed, expiresIn);
} }
} }