Skip to content

Commit

Permalink
Fix #20 Password protected single image
Browse files Browse the repository at this point in the history
  • Loading branch information
alangrainger committed Nov 14, 2024
1 parent 4fb5b09 commit ba6ba8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions app/src/immich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba6ba8c

Please sign in to comment.