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:
+2
-2
@@ -200,8 +200,8 @@ class Immich {
|
||||
link
|
||||
}
|
||||
}
|
||||
} else if (res.status === 401 && jsonBody?.message === 'Invalid password') {
|
||||
// Password authentication required
|
||||
} else if (res.status === 401) {
|
||||
// Password authentication required (handles both "Invalid password" and "Password required" from Immich API)
|
||||
return {
|
||||
valid: true,
|
||||
passwordRequired: true
|
||||
|
||||
Reference in New Issue
Block a user