Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathi21563a62ed46
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsx
index bea72d79df..6d194d1a9e 100644
--- a/web/apps/auth/src/pages/_app.tsx
+++ b/web/apps/auth/src/pages/_app.tsx
@@ -138,7 +138,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
});
const logout = () => {
- void accountLogout().then(() => router.push(PAGES.ROOT));
+ void accountLogout().then(() => router.push("/"));
};
const appContext = {
diff --git a/web/apps/auth/src/pages/auth.tsx b/web/apps/auth/src/pages/auth.tsx
index 7f40226e30..15ba9a0e3d 100644
--- a/web/apps/auth/src/pages/auth.tsx
+++ b/web/apps/auth/src/pages/auth.tsx
@@ -44,7 +44,7 @@ const Page: React.FC = () => {
e.message == CustomError.KEY_MISSING
) {
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.AUTH);
- router.push(PAGES.ROOT);
+ router.push("/");
} else if (e instanceof ApiError && e.httpStatusCode == 401) {
// We get back a 401 Unauthorized if the token is not valid.
showSessionExpiredDialog();
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index df4875cfb1..abd2dbe960 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -306,7 +306,7 @@ export default function App({ Component, pageProps }: AppProps) {
});
const logout = () => {
- void photosLogout().then(() => router.push(PAGES.ROOT));
+ void photosLogout().then(() => router.push("/"));
};
const appContext = {
diff --git a/web/apps/photos/src/pages/deduplicate/index.tsx b/web/apps/photos/src/pages/deduplicate/index.tsx
index 588df0a3dd..e5b766a3bd 100644
--- a/web/apps/photos/src/pages/deduplicate/index.tsx
+++ b/web/apps/photos/src/pages/deduplicate/index.tsx
@@ -58,7 +58,7 @@ export default function Deduplicate() {
const key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
if (!key) {
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.DEDUPLICATE);
- router.push(PAGES.ROOT);
+ router.push("/");
return;
}
showNavBar(true);
diff --git a/web/apps/photos/src/pages/gallery/index.tsx b/web/apps/photos/src/pages/gallery/index.tsx
index 5eba843bc4..fcb31027cd 100644
--- a/web/apps/photos/src/pages/gallery/index.tsx
+++ b/web/apps/photos/src/pages/gallery/index.tsx
@@ -341,7 +341,7 @@ export default function Gallery() {
const token = getToken();
if (!key || !token) {
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.GALLERY);
- router.push(PAGES.ROOT);
+ router.push("/");
return;
}
preloadImage("/images/subscription-card-background");
diff --git a/web/apps/photos/src/pages/shared-albums/index.tsx b/web/apps/photos/src/pages/shared-albums/index.tsx
index f6f2076862..c1715fa878 100644
--- a/web/apps/photos/src/pages/shared-albums/index.tsx
+++ b/web/apps/photos/src/pages/shared-albums/index.tsx
@@ -177,14 +177,14 @@ export default function PublicCollectionGallery() {
nonClosable: true,
proceed: {
text: t("LOGIN"),
- action: () => router.push(PAGES.ROOT),
+ action: () => router.push("/"),
variant: "accent",
},
});
useEffect(() => {
const currentURL = new URL(window.location.href);
- if (currentURL.pathname !== PAGES.ROOT) {
+ if (currentURL.pathname !== "/") {
router.replace(
{
pathname: PAGES.SHARED_ALBUMS,
@@ -192,7 +192,7 @@ export default function PublicCollectionGallery() {
hash: currentURL.hash,
},
{
- pathname: PAGES.ROOT,
+ pathname: "/",
search: currentURL.search,
hash: currentURL.hash,
},
diff --git a/web/packages/accounts/pages/change-email.tsx b/web/packages/accounts/pages/change-email.tsx
index 65c1417b7d..1560829bba 100644
--- a/web/packages/accounts/pages/change-email.tsx
+++ b/web/packages/accounts/pages/change-email.tsx
@@ -1,5 +1,4 @@
import { changeEmail, sendOTTForEmailChange } from "@/accounts/api/user";
-import { PAGES } from "@/accounts/constants/pages";
import { ensure } from "@/utils/ensure";
import { wait } from "@/utils/promise";
import { VerticallyCentered } from "@ente/shared/components/Container";
@@ -25,7 +24,7 @@ const Page: React.FC<PageProps> = () => {
useEffect(() => {
const user = getData(LS_KEYS.USER);
if (!user?.token) {
- router.push(PAGES.ROOT);
+ router.push("/");
}
}, []);
diff --git a/web/packages/accounts/pages/change-password.tsx b/web/packages/accounts/pages/change-password.tsx
index ba48045adb..a525d6c0be 100644
--- a/web/packages/accounts/pages/change-password.tsx
+++ b/web/packages/accounts/pages/change-password.tsx
@@ -47,7 +47,7 @@ const Page: React.FC<PageProps> = () => {
setUser(user);
if (!user?.token) {
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.CHANGE_PASSWORD);
- router.push(PAGES.ROOT);
+ router.push("/");
} else {
setToken(user.token);
}
diff --git a/web/packages/accounts/pages/credentials.tsx b/web/packages/accounts/pages/credentials.tsx
index daf0879223..57b8597fec 100644
--- a/web/packages/accounts/pages/credentials.tsx
+++ b/web/packages/accounts/pages/credentials.tsx
@@ -117,7 +117,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const main = async () => {
const user: User = getData(LS_KEYS.USER);
if (!user?.email) {
- router.push(PAGES.ROOT);
+ router.push("/");
return;
}
setUser(user);
@@ -178,7 +178,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
(keyAttributes && !keyAttributes.memLimit)
) {
clearData();
- router.push(PAGES.ROOT);
+ router.push("/");
return;
}
setKeyAttributes(keyAttributes);
@@ -188,7 +188,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
if (srpAttributes) {
setSrpAttributes(srpAttributes);
} else {
- router.push(PAGES.ROOT);
+ router.push("/");
}
};
main();
@@ -231,7 +231,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
isTwoFactorEnabled: true,
isTwoFactorPasskeysEnabled: true,
});
- InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.ROOT);
+ InMemoryStore.set(MS_KEYS.REDIRECT_URL, "/");
const url =
passkeyVerificationRedirectURL(passkeySessionID);
setPasskeyVerificationData({ passkeySessionID, url });
diff --git a/web/packages/accounts/pages/generate.tsx b/web/packages/accounts/pages/generate.tsx
index f08063f459..a37f3ffcad 100644
--- a/web/packages/accounts/pages/generate.tsx
+++ b/web/packages/accounts/pages/generate.tsx
@@ -50,7 +50,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const user: User = getData(LS_KEYS.USER);
setUser(user);
if (!user?.token) {
- router.push(PAGES.ROOT);
+ router.push("/");
} else if (key) {
if (justSignedUp()) {
setRecoveryModalView(true);
diff --git a/web/packages/accounts/pages/recover.tsx b/web/packages/accounts/pages/recover.tsx
index a3d10da2f3..497afa170e 100644
--- a/web/packages/accounts/pages/recover.tsx
+++ b/web/packages/accounts/pages/recover.tsx
@@ -43,7 +43,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const keyAttributes: KeyAttributes = getData(LS_KEYS.KEY_ATTRIBUTES);
const key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
if (!user?.email) {
- router.push(PAGES.ROOT);
+ router.push("/");
return;
}
if (!user?.encryptedToken && !user?.token) {
diff --git a/web/packages/accounts/pages/two-factor/recover.tsx b/web/packages/accounts/pages/two-factor/recover.tsx
index 23632bce5f..9eb1cf2744 100644
--- a/web/packages/accounts/pages/two-factor/recover.tsx
+++ b/web/packages/accounts/pages/two-factor/recover.tsx
@@ -56,7 +56,7 @@ const Page: React.FC<RecoverPageProps> = ({ appContext, twoFactorType }) => {
const user = getData(LS_KEYS.USER);
const sid = user.passkeySessionID || user.twoFactorSessionID;
if (!user || !user.email || !sid) {
- router.push(PAGES.ROOT);
+ router.push("/");
} else if (
!(user.isTwoFactorEnabled || user.isTwoFactorEnabledPasskey) &&
(user.encryptedToken || user.token)
diff --git a/web/packages/accounts/pages/two-factor/verify.tsx b/web/packages/accounts/pages/two-factor/verify.tsx
index d8897045df..aaefd5df64 100644
--- a/web/packages/accounts/pages/two-factor/verify.tsx
+++ b/web/packages/accounts/pages/two-factor/verify.tsx
@@ -35,7 +35,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
const main = async () => {
const user: User = getData(LS_KEYS.USER);
if (!user?.email || !user.twoFactorSessionID) {
- router.push(PAGES.ROOT);
+ router.push("/");
} else if (
!user.isTwoFactorEnabled &&
(user.encryptedToken || user.token)
diff --git a/web/packages/accounts/pages/verify.tsx b/web/packages/accounts/pages/verify.tsx
index 9c39cad264..d2e468571f 100644
--- a/web/packages/accounts/pages/verify.tsx
+++ b/web/packages/accounts/pages/verify.tsx
@@ -61,7 +61,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
LS_KEYS.KEY_ATTRIBUTES,
);
if (!user?.email) {
- router.push(PAGES.ROOT);
+ router.push("/");
} else if (
keyAttributes?.encryptedKey &&
(user.token || user.encryptedToken)
diff --git a/web/packages/shared/constants/pages.tsx b/web/packages/shared/constants/pages.tsx
index 5fef798a01..12c36301a8 100644
--- a/web/packages/shared/constants/pages.tsx
+++ b/web/packages/shared/constants/pages.tsx
@@ -34,16 +34,3 @@ export enum AUTH_PAGES {
AUTH = "/auth",
}
-export enum ACCOUNTS_PAGES {
- CREDENTIALS = "/credentials",
- LOGIN = "/login",
- RECOVER = "/recover",
- SIGNUP = "/signup",
- TWO_FACTOR_SETUP = "/two-factor/setup",
- TWO_FACTOR_VERIFY = "/two-factor/verify",
- TWO_FACTOR_RECOVER = "/two-factor/recover",
- VERIFY = "/verify",
- ROOT = "/",
- PASSKEYS = "/passkeys",
- GENERATE = "/generate",
-}