From ba6ba8c8112663788d3cbc71e2734d5c75d92bbf Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Thu, 14 Nov 2024 12:38:05 +0100 Subject: [PATCH] Fix #20 Password protected single image --- app/package.json | 2 +- app/src/immich.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/package.json b/app/package.json index f06aa54..05cd435 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.4.1", + "version": "1.4.2", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/immich.ts b/app/src/immich.ts index d04f73c..035bc1c 100644 --- a/app/src/immich.ts +++ b/app/src/immich.ts @@ -99,8 +99,9 @@ class Immich { // This is an individual item (not a gallery) log('Serving link ' + request.key) const asset = link.assets[0] - if (asset.type === AssetType.image && !getConfigOption('ipp.singleImageGallery')) { - // For photos, output the image directly unless configured to show a gallery + if (asset.type === AssetType.image && !getConfigOption('ipp.singleImageGallery') && !request.password) { + // For photos, output the image directly unless configured to show a gallery, + // or unless it's a password-protected link await render.assetBuffer(request, res, link.assets[0], ImageSize.preview) } else { // Show a gallery page