mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 09:15:35 +03:00
feat: shared links custom URL (#19999)
* feat: custom url for shared links * feat: use a separate route and query param --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
@@ -184,7 +184,7 @@ export const getAssetOriginalUrl = (options: string | AssetUrlOptions) => {
|
||||
options = { id: options };
|
||||
}
|
||||
const { id, cacheKey } = options;
|
||||
return createUrl(getAssetOriginalPath(id), { key: authManager.key, c: cacheKey });
|
||||
return createUrl(getAssetOriginalPath(id), { ...authManager.params, c: cacheKey });
|
||||
};
|
||||
|
||||
export const getAssetThumbnailUrl = (options: string | (AssetUrlOptions & { size?: AssetMediaSize })) => {
|
||||
@@ -192,7 +192,7 @@ export const getAssetThumbnailUrl = (options: string | (AssetUrlOptions & { size
|
||||
options = { id: options };
|
||||
}
|
||||
const { id, size, cacheKey } = options;
|
||||
return createUrl(getAssetThumbnailPath(id), { size, key: authManager.key, c: cacheKey });
|
||||
return createUrl(getAssetThumbnailPath(id), { ...authManager.params, size, c: cacheKey });
|
||||
};
|
||||
|
||||
export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => {
|
||||
@@ -200,7 +200,7 @@ export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => {
|
||||
options = { id: options };
|
||||
}
|
||||
const { id, cacheKey } = options;
|
||||
return createUrl(getAssetPlaybackPath(id), { key: authManager.key, c: cacheKey });
|
||||
return createUrl(getAssetPlaybackPath(id), { ...authManager.params, c: cacheKey });
|
||||
};
|
||||
|
||||
export const getProfileImageUrl = (user: UserResponseDto) =>
|
||||
@@ -257,8 +257,9 @@ export const copyToClipboard = async (secret: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const makeSharedLinkUrl = (key: string) => {
|
||||
return new URL(`share/${key}`, get(serverConfig).externalDomain || globalThis.location.origin).href;
|
||||
export const makeSharedLinkUrl = (sharedLink: SharedLinkResponseDto) => {
|
||||
const path = sharedLink.slug ? `s/${sharedLink.slug}` : `share/${sharedLink.key}`;
|
||||
return new URL(path, get(serverConfig).externalDomain || globalThis.location.origin).href;
|
||||
};
|
||||
|
||||
export const oauth = {
|
||||
|
||||
Reference in New Issue
Block a user