π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[ui] Fix memories landing redirect
AmanRajSinghMouryad5b5cda2ac05
diff --git a/web/apps/memories/src/services/public-memory-page.ts b/web/apps/memories/src/services/public-memory-page.tsindex ce93bf439c..fddf361627 100644--- a/web/apps/memories/src/services/public-memory-page.ts+++ b/web/apps/memories/src/services/public-memory-page.ts@@ -1,6 +1,6 @@import { isHTTPErrorWithStatus } from "ente-base/http";import log from "ente-base/log";-import { memoriesAppOrigin } from "ente-base/origins";+import { isCustomMemoriesAppOrigin } from "ente-base/origins";import type { EnteFile } from "ente-media/file";import {decryptMemoryShareMetadata,@@ -38,7 +38,13 @@ export const loadPublicMemoryPage = async (const accessToken = extractAccessTokenFromURL(currentURL);if (!accessToken) {- return { kind: "redirect", redirectURL: memoriesAppOrigin() };+ if (!isCustomMemoriesAppOrigin) {+ return { kind: "redirect", redirectURL: "https://ente.com" };+ }+ return {+ kind: "error",+ errorMessage: "Invalid memory link. Missing access token.",+ };}const shareKey = await extractMemoryShareKeyFromURL(currentURL);diff --git a/web/packages/base/origins.ts b/web/packages/base/origins.tsindex 44510bb59e..445087b08a 100644--- a/web/packages/base/origins.ts+++ b/web/packages/base/origins.ts@@ -121,6 +121,13 @@ export const isCustomShareAppOrigin =export const shareAppOrigin = (): string =>process.env.NEXT_PUBLIC_ENTE_SHARE_ENDPOINT ?? "https://share.ente.io";+/**+ * A static build time constant that is `true` if {@link memoriesAppOrigin} has+ * been customized.+ */+export const isCustomMemoriesAppOrigin =+ !!process.env.NEXT_PUBLIC_ENTE_MEMORIES_ENDPOINT;+/*** Return the origin/path that serves the memories app landing experience.*