ultisuite-client/lib/auth/check-mail-address.ts
R3D347HR4Y 496b1dfc1f
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
feat: enhance authentication flow with new password management and signup components
- Introduced PasswordFieldBlock component for improved password input handling, including visibility toggle and strength evaluation.
- Added SignupCredentialsFields component to streamline user signup with email availability checks and password confirmation.
- Updated FlowChallengeForm to integrate new components, enhancing user experience during authentication.
- Refactored CSS styles for consistent design across authentication components, ensuring a cohesive look and feel.
2026-06-19 23:47:16 +02:00

23 lines
570 B
TypeScript

export type MailAddressAvailability = {
available: boolean
reason?: string
}
export async function checkMailAddressAvailability(
local: string,
domain: string
): Promise<MailAddressAvailability> {
const params = new URLSearchParams({
local,
domain,
})
const res = await fetch(`/api/v1/mail/addresses/check?${params.toString()}`, {
credentials: "include",
headers: { Accept: "application/json" },
})
if (!res.ok) {
throw new Error(`address check failed (${res.status})`)
}
return (await res.json()) as MailAddressAvailability
}