Rename
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user