Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename

Manav Rathi488886d68549
diff --git a/web/packages/accounts/components/utils/second-factor-choice.ts b/web/packages/accounts/components/utils/second-factor-choice.ts
index e263bb6af3..1557255ae3 100644
--- a/web/packages/accounts/components/utils/second-factor-choice.ts
+++ b/web/packages/accounts/components/utils/second-factor-choice.ts
@@ -3,9 +3,9 @@
* needs to be in a separate file to allow fast refresh.
*/
+import type { EmailOrSRPVerificationResponse } from "ente-accounts/services/user";
import { useModalVisibility } from "ente-base/components/utils/modal";
import { useCallback, useMemo, useRef } from "react";
-import type { UserVerificationResponse } from "../../services/user";
import type { SecondFactorType } from "../SecondFactorChoice";
/**
@@ -39,7 +39,7 @@ export const useSecondFactorChoiceIfNeeded = () => {
);
const userVerificationResultAfterResolvingSecondFactorChoice = useCallback(
- async (response: UserVerificationResponse) => {
+ async (response: EmailOrSRPVerificationResponse) => {
const {
twoFactorSessionID: _twoFactorSessionIDV1,
twoFactorSessionIDV2: _twoFactorSessionIDV2,
diff --git a/web/packages/accounts/services/srp.ts b/web/packages/accounts/services/srp.ts
index de8c2964e0..295682a944 100644
--- a/web/packages/accounts/services/srp.ts
+++ b/web/packages/accounts/services/srp.ts
@@ -14,7 +14,7 @@ import { v4 as uuidv4 } from "uuid";
import { z } from "zod/v4";
import {
RemoteEmailOrSRPVerificationResponse,
- type UserVerificationResponse,
+ type EmailOrSRPVerificationResponse,
} from "./user";
/**
@@ -582,7 +582,7 @@ export const srpVerificationUnauthorizedErrorMessage =
* @param kek The user's key encryption key as a base64 string.
*
* @returns If SRP verification is successful, it returns a
- * {@link UserVerificationResponse}.
+ * {@link EmailOrSRPVerificationResponse}.
*
* @throws An Error with {@link srpVerificationUnauthorizedErrorMessage} in case
* there is no such account, or if the credentials (kek) are incorrect.
@@ -590,7 +590,7 @@ export const srpVerificationUnauthorizedErrorMessage =
export const verifySRP = async (
{ srpUserID, srpSalt }: SRPAttributes,
kek: string,
-): Promise<UserVerificationResponse> => {
+): Promise<EmailOrSRPVerificationResponse> => {
const loginSubKey = await deriveSRPLoginSubKey(kek);
const srpClient = await generateSRPClient(srpSalt, srpUserID, loginSubKey);
diff --git a/web/packages/accounts/services/user.ts b/web/packages/accounts/services/user.ts
index 672e5639f7..5a3855416b 100644
--- a/web/packages/accounts/services/user.ts
+++ b/web/packages/accounts/services/user.ts
@@ -531,7 +531,7 @@ export const sendOTT = async (
* attributes, then the following will be set:
* - {@link token}
*/
-export interface UserVerificationResponse {
+export interface EmailOrSRPVerificationResponse {
/**
* The user's ID.
*/
@@ -630,7 +630,7 @@ export const verifyEmail = async (
email: string,
ott: string,
source: string | undefined,
-): Promise<UserVerificationResponse> => {
+): Promise<EmailOrSRPVerificationResponse> => {
const res = await fetch(await apiURL("/users/verify-email"), {
method: "POST",
headers: publicRequestHeaders(),