fix: handle password-protected shares with Immich v2.6+

Immich v2.6 changed the API response for password-protected shared links
from "Invalid password" to "Password required" when no password token is
provided. The previous string match on the message caused the proxy to
fall through to the catch-all and return 404 instead of showing the
password entry page.

Match on the 401 status code alone, since this endpoint only returns 401
for password-related reasons. This is backwards compatible with older
Immich versions and resilient to future message wording changes.

Fixes #198

Made-with: Cursor
This commit is contained in:
Fraggar
2026-03-21 22:26:41 +01:00
parent ac00570082
commit 90b8a01b8a
+2 -2
View File
@@ -200,8 +200,8 @@ class Immich {
link link
} }
} }
} else if (res.status === 401 && jsonBody?.message === 'Invalid password') { } else if (res.status === 401) {
// Password authentication required // Password authentication required (handles both "Invalid password" and "Password required" from Immich API)
return { return {
valid: true, valid: true,
passwordRequired: true passwordRequired: true