RED-7140: get userId before async method #54

Merged
ali.oezyetimoglu1 merged 1 commits from RED-7140-3 into master 2023-07-20 16:01:23 +02:00

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);