import type { RequestHandler } from '@sveltejs/kit'; import type { AuthDeps } from '../deps.js'; import type { MailBuilder } from '../email/builders.js'; export interface RegisterHandlerOptions { /** * Build the email-verification mail (mirrors `inviteEmail`). Receives the * resolved context (recipient `name`, verify `url`, `appName`, `from`, and the * `t` bundle) and returns `{ subject, html, text }` (optionally a `from` to * override the configured sender). Defaults to a localized template driven by * `config.email.locale`. */ verificationEmail?: MailBuilder; /** * Treat signups from an **emailed** invitation as already email-verified. * * The reasoning only works for one of the two ways an invitation reaches * someone. A mail sent to the invited address, carrying a secret token, and * redeemed with that token, demonstrates the registrant reads that mailbox — * a separate verification mail would verify nothing new, and since register * also auto-logs-in, it would arrive after they are already signed in. * * A link the admin copied out of the panel (#68) demonstrates nothing about * the address it names: it travelled whatever channel the admin chose, to * whoever they chose. So this flag is honoured **only** when the invitation * carries an `emailedAt` — an invitation minted without delivery gets the * ordinary verification token and mail, regardless of this setting. * * Know precisely what `emailedAt` attests: **a transport accepted the * message**. It is exactly as strong as the transport is. The bundled console * transport — which the quickstart runs on — writes the mail, token and all, * to the process log and never fails, so under it this flag turns log access * into a pre-verified account. Enable it only with a transport that really * delivers to the address. * * Before #149 the flag rested on a claim the code did not check ("emailed to * that exact address"): registration was gated on knowing the address, and * nothing was ever emailed to prove it. * * Defaults to `false` — the verification token + mail are issued exactly as * before, for consumers that gate on `emailVerified`. Covers only the * **register** path; email *change* always verifies the new address * independently (see `createVerifyEmailChangeHandler`), since there is no * prior proof of ownership for it. */ autoVerifyInvited?: boolean; } export declare function createRegisterHandler(deps: AuthDeps, options?: RegisterHandlerOptions): { POST: RequestHandler; };