From 488886d68549b6c19bd71c9748d1881d8596d4cd Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 11 Jun 2025 11:06:32 +0530 Subject: [PATCH] Rename --- .../accounts/components/utils/second-factor-choice.ts | 4 ++-- web/packages/accounts/services/srp.ts | 6 +++--- web/packages/accounts/services/user.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) 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 => { +): Promise => { 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 => { +): Promise => { const res = await fetch(await apiURL("/users/verify-email"), { method: "POST", headers: publicRequestHeaders(),