Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathi68d475c224fd
diff --git a/web/packages/accounts/components/Login.tsx b/web/packages/accounts/components/Login.tsx
index e44a099a44..8dd8fad6e3 100644
--- a/web/packages/accounts/components/Login.tsx
+++ b/web/packages/accounts/components/Login.tsx
@@ -8,8 +8,8 @@ import { LS_KEYS, setData, setLSUser } from "@ente/shared/storage/localStorage";
import { Input, Stack, Typography } from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
-import { getSRPAttributes } from "../api/srp";
import { PAGES } from "../constants/pages";
+import { getSRPAttributes } from "../services/srp-remote";
import { sendOtt } from "../services/user";
interface LoginProps {
diff --git a/web/packages/accounts/pages/change-password.tsx b/web/packages/accounts/pages/change-password.tsx
index 2dc9ab7fea..3031cd5c95 100644
--- a/web/packages/accounts/pages/change-password.tsx
+++ b/web/packages/accounts/pages/change-password.tsx
@@ -1,14 +1,14 @@
-import {
- getSRPAttributes,
- startSRPSetup,
- updateSRPAndKeys,
-} from "@/accounts/api/srp";
import {
convertBase64ToBuffer,
convertBufferToBase64,
generateSRPClient,
generateSRPSetupAttributes,
} from "@/accounts/services/srp";
+import {
+ getSRPAttributes,
+ startSRPSetup,
+ updateSRPAndKeys,
+} from "@/accounts/services/srp-remote";
import {
FormPaper,
FormPaperFooter,
diff --git a/web/packages/accounts/pages/credentials.tsx b/web/packages/accounts/pages/credentials.tsx
index 13e21fde20..7a12367264 100644
--- a/web/packages/accounts/pages/credentials.tsx
+++ b/web/packages/accounts/pages/credentials.tsx
@@ -39,8 +39,6 @@ import { Stack } from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
import { useCallback, useEffect, useState } from "react";
-import type { SRPAttributes } from "../api/srp";
-import { getSRPAttributes } from "../api/srp";
import {
LoginFlowFormFooter,
PasswordHeader,
@@ -62,6 +60,8 @@ import {
generateSRPSetupAttributes,
loginViaSRP,
} from "../services/srp";
+import type { SRPAttributes } from "../services/srp-remote";
+import { getSRPAttributes } from "../services/srp-remote";
import type { PageProps } from "../types/page";
const Page: React.FC<PageProps> = ({ appContext }) => {
diff --git a/web/packages/accounts/pages/verify.tsx b/web/packages/accounts/pages/verify.tsx
index 490e337b36..d0c61721ec 100644
--- a/web/packages/accounts/pages/verify.tsx
+++ b/web/packages/accounts/pages/verify.tsx
@@ -27,8 +27,6 @@ import { t } from "i18next";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { Trans } from "react-i18next";
-import type { SRPAttributes, SRPSetupAttributes } from "../api/srp";
-import { getSRPAttributes } from "../api/srp";
import {
LoginFlowFormFooter,
VerifyingPasskey,
@@ -40,6 +38,8 @@ import {
} from "../services/passkey";
import { stashedRedirect, unstashRedirect } from "../services/redirect";
import { configureSRP } from "../services/srp";
+import type { SRPAttributes, SRPSetupAttributes } from "../services/srp-remote";
+import { getSRPAttributes } from "../services/srp-remote";
import { putAttributes, sendOtt, verifyOtt } from "../services/user";
import type { PageProps } from "../types/page";
diff --git a/web/packages/accounts/services/session.ts b/web/packages/accounts/services/session.ts
index 0830ab923b..7d2ffb18b6 100644
--- a/web/packages/accounts/services/session.ts
+++ b/web/packages/accounts/services/session.ts
@@ -3,8 +3,8 @@ import { ensureLocalUser } from "@/base/local-user";
import { apiURL } from "@/base/origins";
import { getData, LS_KEYS } from "@ente/shared/storage/localStorage";
import type { KeyAttributes } from "@ente/shared/user/types";
-import type { SRPAttributes } from "../api/srp";
-import { getSRPAttributes } from "../api/srp";
+import type { SRPAttributes } from "./srp-remote";
+import { getSRPAttributes } from "./srp-remote";
type SessionValidity =
| { status: "invalid" }
diff --git a/web/packages/accounts/api/srp.ts b/web/packages/accounts/services/srp-remote.ts
similarity index 100%
rename from web/packages/accounts/api/srp.ts
rename to web/packages/accounts/services/srp-remote.ts
diff --git a/web/packages/accounts/services/srp.ts b/web/packages/accounts/services/srp.ts
index 1e19b1d81b..5d2242e484 100644
--- a/web/packages/accounts/services/srp.ts
+++ b/web/packages/accounts/services/srp.ts
@@ -6,13 +6,13 @@ import { getToken } from "@ente/shared/storage/localStorage/helpers";
import type { KeyAttributes } from "@ente/shared/user/types";
import { SRP, SrpClient } from "fast-srp-hap";
import { v4 as uuidv4 } from "uuid";
-import type { SRPAttributes, SRPSetupAttributes } from "../api/srp";
+import type { SRPAttributes, SRPSetupAttributes } from "./srp-remote";
import {
completeSRPSetup,
createSRPSession,
startSRPSetup,
verifySRPSession,
-} from "../api/srp";
+} from "./srp-remote";
const SRP_PARAMS = SRP.params["4096"];
diff --git a/web/packages/shared/components/VerifyMasterPasswordForm.tsx b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
index 6a07025393..ebe1154130 100644
--- a/web/packages/shared/components/VerifyMasterPasswordForm.tsx
+++ b/web/packages/shared/components/VerifyMasterPasswordForm.tsx
@@ -1,4 +1,4 @@
-import type { SRPAttributes } from "@/accounts/api/srp";
+import type { SRPAttributes } from "@/accounts/services/srp-remote";
import { sharedCryptoWorker } from "@/base/crypto";
import log from "@/base/log";
import { Input, type ButtonProps } from "@mui/material";