added validations
This commit is contained in:
@@ -123,9 +123,9 @@ public class SamlSuccessHandler implements AuthenticationSuccessHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public void validateToken(String token, String codiceFiscale) {
|
||||
public void validateToken(String token, String codiceFiscale, String hubUuid) {
|
||||
SamlResponseEntity samlResponseLogEntity = samlResponseLogRepository.findByToken(token);
|
||||
if (samlResponseLogEntity == null) {
|
||||
if (samlResponseLogEntity == null || Boolean.FALSE.equals(hubUuid.equals(samlResponseLogEntity.getHubUuid()))) {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.INVALID_TOKEN_MSG));
|
||||
}
|
||||
@@ -136,7 +136,6 @@ public class SamlSuccessHandler implements AuthenticationSuccessHandler {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.INVALID_TOKEN_MSG));
|
||||
}
|
||||
samlResponseLogRepository.delete(samlResponseLogEntity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user