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
+2 -2
View File
@@ -5,8 +5,8 @@ function createAssetViewingStore() {
const viewingAssetStoreState = writable<AssetResponseDto>();
const viewState = writable<boolean>(false);
const setAssetId = async (id: string, key?: string) => {
const { data } = await api.assetApi.getAssetById({ id, key });
const setAssetId = async (id: string) => {
const { data } = await api.assetApi.getAssetById({ id, key: api.getKey() });
viewingAssetStoreState.set(data);
viewState.set(true);
};
+10 -3
View File
@@ -58,7 +58,10 @@ export class AssetStore {
this.assetToBucket = {};
this.albumAssets = new Set();
const { data: buckets } = await api.assetApi.getTimeBuckets(this.options);
const { data: buckets } = await api.assetApi.getTimeBuckets({
...this.options,
key: api.getKey(),
});
this.buckets = buckets.map((bucket) => {
const unwrappedWidth = (3 / 2) * bucket.count * THUMBNAIL_HEIGHT * (7 / 10);
@@ -107,7 +110,11 @@ export class AssetStore {
bucket.cancelToken = new AbortController();
const { data: assets } = await api.assetApi.getByTimeBucket(
{ ...this.options, timeBucket: bucketDate },
{
...this.options,
timeBucket: bucketDate,
key: api.getKey(),
},
{ signal: bucket.cancelToken.signal },
);
@@ -117,7 +124,7 @@ export class AssetStore {
albumId: this.albumId,
timeBucket: bucketDate,
size: this.options.size,
key: this.options.key,
key: api.getKey(),
},
{ signal: bucket.cancelToken.signal },
);