Merge branch 'RED-7140-3' into 'master'

RED-7140: get userId before async method

Closes RED-7140

See merge request redactmanager/persistence-service!54
This commit is contained in:
Ali Oezyetimoglu 2023-07-20 16:01:22 +02:00
commit 6e274fccf0

View File

@ -199,8 +199,8 @@ public class DownloadController implements DownloadResource {
@PreAuthorize("hasAuthority('" + PROCESS_DOWNLOAD + "')")
public CompletableFuture<ResponseEntity<InputStreamResource>> downloadFile(@RequestParam(STORAGE_ID) String storageId,
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline) {
var userId = KeycloakSecurity.getUserId();
return CompletableFuture.supplyAsync(() -> {
var userId = KeycloakSecurity.getUserId();
var downloadStatus = getDownloadStatus(storageId, userId);
var fileDownloadStream = getFileForDownload(storageId, userId);