Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename

Manav Rathi936d57809335
diff --git a/web/packages/accounts/pages/generate.tsx b/web/packages/accounts/pages/generate.tsx
index 776443b782..0f72c562c0 100644
--- a/web/packages/accounts/pages/generate.tsx
+++ b/web/packages/accounts/pages/generate.tsx
@@ -12,7 +12,7 @@ import {
configureSRP,
generateKeyAndSRPAttributes,
} from "ente-accounts/services/srp";
-import { putAttributes } from "ente-accounts/services/user";
+import { putUserKeyAttributes } from "ente-accounts/services/user";
import { LinkButton } from "ente-base/components/LinkButton";
import { LoadingIndicator } from "ente-base/components/loaders";
import { useBaseContext } from "ente-base/context";
@@ -70,7 +70,7 @@ const Page: React.FC = () => {
const { keyAttributes, masterKey, srpSetupAttributes } =
await generateKeyAndSRPAttributes(passphrase);
- await putAttributes(keyAttributes);
+ await putUserKeyAttributes(keyAttributes);
await configureSRP(srpSetupAttributes);
await generateAndSaveIntermediateKeyAttributes(
passphrase,
diff --git a/web/packages/accounts/pages/verify.tsx b/web/packages/accounts/pages/verify.tsx
index 2780c04c45..1ef60d002d 100644
--- a/web/packages/accounts/pages/verify.tsx
+++ b/web/packages/accounts/pages/verify.tsx
@@ -23,7 +23,7 @@ import type {
} from "ente-accounts/services/srp-remote";
import { getSRPAttributes } from "ente-accounts/services/srp-remote";
import {
- putAttributes,
+ putUserKeyAttributes,
sendOTT,
verifyEmail,
} from "ente-accounts/services/user";
@@ -141,7 +141,7 @@ const Page: React.FC = () => {
"originalKeyAttributes",
);
if (originalKeyAttributes) {
- await putAttributes(originalKeyAttributes);
+ await putUserKeyAttributes(originalKeyAttributes);
}
if (getData("srpSetupAttributes")) {
const srpSetupAttributes: SRPSetupAttributes =
diff --git a/web/packages/accounts/services/session.ts b/web/packages/accounts/services/session.ts
index 54f2dff2ac..f2cab12391 100644
--- a/web/packages/accounts/services/session.ts
+++ b/web/packages/accounts/services/session.ts
@@ -8,7 +8,7 @@ import { nullToUndefined } from "ente-utils/transform";
import { z } from "zod";
import type { SRPAttributes } from "./srp-remote";
import { getSRPAttributes } from "./srp-remote";
-import { putAttributes, RemoteKeyAttributes } from "./user";
+import { putUserKeyAttributes, RemoteKeyAttributes } from "./user";
type SessionValidity =
| { status: "invalid" }
@@ -155,7 +155,7 @@ export const isSessionInvalid = async (): Promise<boolean> => {
if (!hasSetKeys) {
const originalKeyAttributes = getData("originalKeyAttributes");
if (originalKeyAttributes)
- await putAttributes(originalKeyAttributes);
+ await putUserKeyAttributes(originalKeyAttributes);
}
} catch (e) {
log.warn("Failed to check session validity", e);
diff --git a/web/packages/accounts/services/user.ts b/web/packages/accounts/services/user.ts
index 3033366e49..6f5d55f85e 100644
--- a/web/packages/accounts/services/user.ts
+++ b/web/packages/accounts/services/user.ts
@@ -198,7 +198,7 @@ export type TwoFactorAuthorizationResponse = z.infer<
/**
* Update or set the user's {@link KeyAttributes} on remote.
*/
-export const putAttributes = async (keyAttributes: KeyAttributes) =>
+export const putUserKeyAttributes = async (keyAttributes: KeyAttributes) =>
ensureOk(
await fetch(await apiURL("/users/attributes"), {
method: "PUT",