1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 03:41:58 +00:00

Fix #20 Password protected single image

This commit is contained in:
Alan Grainger 2024-11-14 12:38:05 +01:00
parent 4fb5b094f4
commit ba6ba8c811
2 changed files with 4 additions and 3 deletions

View file

@ -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",

View file

@ -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