RED-7140: get userId before async method

This commit is contained in:
Ali Oezyetimoglu 2023-07-20 15:55:29 +02:00
parent 883cee61c5
commit 33638c2b5e

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