export type DisableMFAAuthAppRequest = {token?: string | undefined}; export type CreateApiResourcesUsersV1MfaAuthenticatorDeviceIdDisableVerifyArgs = {deviceId: string, 'frontegg-user-id': string, body: DisableMFAAuthAppRequest}; export type CreateApiResourcesUsersV1MfaAuthenticatorDeviceIdDisableVerifyOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable authenticator app MFA * * POST /resources/users/v1/mfa/authenticator/{deviceId}/disable/verify */ export const createApiResourcesUsersV1MfaAuthenticatorDeviceIdDisableVerify = async (args: CreateApiResourcesUsersV1MfaAuthenticatorDeviceIdDisableVerifyArgs, options?: CreateApiResourcesUsersV1MfaAuthenticatorDeviceIdDisableVerifyOptions) => { const {baseUrl = "http://localhost:8181", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['frontegg-user-id'] != null) headers.set("frontegg-user-id", String(args['frontegg-user-id'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/resources/users/v1/mfa/authenticator/${encodeURIComponent(String(args.deviceId))}/disable/verify${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };