fix: shared link custom URL photo access authentication (#20534)

This commit is contained in:
Gaurav Yadav 2025-08-06 02:52:19 +05:30 committed by GitHub
parent 4179c8a17d
commit d430b869ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -23,8 +23,8 @@ export const isLockedFolderRoute = (route?: string | null) => !!route?.startsWit
export const isAssetViewerRoute = (target?: NavigationTarget | null) => export const isAssetViewerRoute = (target?: NavigationTarget | null) =>
!!(target?.route.id?.endsWith('/[[assetId=id]]') && 'assetId' in (target?.params || {})); !!(target?.route.id?.endsWith('/[[assetId=id]]') && 'assetId' in (target?.params || {}));
export function getAssetInfoFromParam({ assetId, key }: { assetId?: string; key?: string }) { export function getAssetInfoFromParam({ assetId, slug, key }: { assetId?: string; key?: string; slug?: string }) {
return assetId ? getAssetInfo({ id: assetId, key }) : undefined; return assetId ? getAssetInfo({ id: assetId, slug, key }) : undefined;
} }
function currentUrlWithoutAsset() { function currentUrlWithoutAsset() {

View File

@ -17,7 +17,13 @@ export const asQueryString = ({ slug, key }: { slug?: string; key?: string }) =>
return params.toString(); return params.toString();
}; };
export const loadSharedLink = async ({ url, params }: { url: URL; params: { key?: string; slug?: string } }) => { export const loadSharedLink = async ({
url,
params,
}: {
url: URL;
params: { key?: string; slug?: string; assetId?: string };
}) => {
const { key, slug } = params; const { key, slug } = params;
await authenticate(url, { public: true }); await authenticate(url, { public: true });