This commit is contained in:
Manav Rathi
2025-06-11 11:06:32 +05:30
parent 485fbcf393
commit 488886d685
3 changed files with 7 additions and 7 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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(),