mirror of
https://github.com/alangrainger/immich-public-proxy.git
synced 2024-12-29 12:21:57 +00:00
Fix #20 Password protected single image
This commit is contained in:
parent
4fb5b094f4
commit
ba6ba8c811
2 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "immich-public-proxy",
|
"name": "immich-public-proxy",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"build": "npx tsc",
|
"build": "npx tsc",
|
||||||
|
|
|
@ -99,8 +99,9 @@ class Immich {
|
||||||
// This is an individual item (not a gallery)
|
// This is an individual item (not a gallery)
|
||||||
log('Serving link ' + request.key)
|
log('Serving link ' + request.key)
|
||||||
const asset = link.assets[0]
|
const asset = link.assets[0]
|
||||||
if (asset.type === AssetType.image && !getConfigOption('ipp.singleImageGallery')) {
|
if (asset.type === AssetType.image && !getConfigOption('ipp.singleImageGallery') && !request.password) {
|
||||||
// For photos, output the image directly unless configured to show a gallery
|
// 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)
|
await render.assetBuffer(request, res, link.assets[0], ImageSize.preview)
|
||||||
} else {
|
} else {
|
||||||
// Show a gallery page
|
// Show a gallery page
|
||||||
|
|
Loading…
Reference in a new issue