refactor(web): shared link key auth (#3855)

This commit is contained in:
Jason Rasmussen
2023-08-25 00:03:28 -04:00
committed by GitHub
parent 10c2bda3a9
commit 9bbef4a97b
21 changed files with 115 additions and 108 deletions

View File

@@ -6,7 +6,6 @@
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
export let filename = 'immich.zip';
export let sharedLinkKey: string | undefined = undefined;
export let menuItem = false;
const { getAssets, clearSelect } = getAssetControlContext();
@@ -15,12 +14,12 @@
const assets = Array.from(getAssets());
if (assets.length === 1) {
clearSelect();
await downloadFile(assets[0], sharedLinkKey);
await downloadFile(assets[0]);
return;
}
clearSelect();
await downloadArchive(filename, { assetIds: assets.map((asset) => asset.id) }, sharedLinkKey);
await downloadArchive(filename, { assetIds: assets.map((asset) => asset.id) });
};
</script>

View File

@@ -20,7 +20,7 @@
assetIdsDto: {
assetIds: Array.from(getAssets()).map((asset) => asset.id),
},
key: sharedLink.key,
key: api.getKey(),
});
for (const result of results) {