π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix: Prevent redirect to ente.io for self-hosted instances
Johan Biju paul7d06c30b80d1
diff --git a/web/apps/embed/src/pages/index.tsx b/web/apps/embed/src/pages/index.tsxindex 746cb29acc..6b2153a3d3 100644--- a/web/apps/embed/src/pages/index.tsx+++ b/web/apps/embed/src/pages/index.tsx@@ -12,6 +12,7 @@ import {type PublicAlbumsCredentials,} from "ente-base/http";import log from "ente-base/log";+import { isCustomAlbumsAppOrigin } from "ente-base/origins";import { downloadManager } from "ente-gallery/services/download";import { extractCollectionKeyFromShareURL } from "ente-gallery/services/share";import { sortFiles } from "ente-gallery/utils/file";@@ -130,8 +131,11 @@ export default function EmbedGallery() {const t = currentURL.searchParams.get("t");const ck = await extractCollectionKeyFromShareURL(currentURL);if (!t && !ck) {- window.location.href = "https://ente.io";- redirectingToWebsite = true;+ // Only redirect to ente.io if this is NOT a custom/self-hosted instance+ if (!isCustomAlbumsAppOrigin) {+ window.location.href = "https://ente.io";+ redirectingToWebsite = true;+ }}if (!t || !ck) {return;diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsxindex 79eb377646..b08d3cfc84 100644--- a/web/apps/photos/src/pages/shared-albums.tsx+++ b/web/apps/photos/src/pages/shared-albums.tsx@@ -4,6 +4,7 @@ import AddPhotoAlternateOutlinedIcon from "@mui/icons-material/AddPhotoAlternateimport CloseIcon from "@mui/icons-material/Close";import DownloadIcon from "@mui/icons-material/Download";import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";+import {Box,Button,@@ -55,7 +56,7 @@ import {type PublicAlbumsCredentials,} from "ente-base/http";import log from "ente-base/log";-import { albumsAppOrigin, shouldOnlyServeAlbumsApp } from "ente-base/origins";+import { albumsAppOrigin, shouldOnlyServeAlbumsApp, isCustomAlbumsAppOrigin } from "ente-base/origins";import { FullScreenDropZone } from "ente-gallery/components/FullScreenDropZone";import {useSaveGroups,@@ -205,8 +206,11 @@ export default function PublicCollectionGallery() {const t = currentURL.searchParams.get("t");const ck = await extractCollectionKeyFromShareURL(currentURL);if (!t && !ck) {- window.location.href = "https://ente.io";- redirectingToWebsite = true;+ // Only redirect to ente.io if this is NOT a custom/self-hosted instance+ if (!isCustomAlbumsAppOrigin) {+ window.location.href = "https://ente.io";+ redirectingToWebsite = true;+ }}if (!t || !ck) {return;@@ -442,18 +446,18 @@ export default function PublicCollectionGallery() {() =>publicCollection && publicFiles? {- component: (- <FileListHeader- {...{- publicCollection,- publicFiles,- downloadEnabled,- onAddSaveGroup,- }}- />- ),- height: fileListHeaderHeight,- }+ component: (+ <FileListHeader+ {...{+ publicCollection,+ publicFiles,+ downloadEnabled,+ onAddSaveGroup,+ }}+ />+ ),+ height: fileListHeaderHeight,+ }: undefined,[onAddSaveGroup, publicCollection, publicFiles, downloadEnabled],);