props.ts overview
The props, label sets and default copy of the bundled form components, in a .ts module because a Svelte instance script cannot export types.
Exports Grouped by Category
- utils
- EmailOtpFormProps (interface)
- EmailOtpLabels (interface)
- MagicLinkFormProps (interface)
- MagicLinkLabels (interface)
- PasswordResetConfirmFormProps (interface)
- PasswordResetConfirmLabels (interface)
- PasswordResetRequestFormProps (interface)
- PasswordResetRequestLabels (interface)
- SecondFactorProps (interface)
- SendCaptchaProps (interface)
- SignInFormProps (interface)
- SignInLabels (interface)
- SignUpFormProps (interface)
- SignUpLabels (interface)
utils
EmailOtpFormProps (interface)
Props for EmailOtpForm.
Signature
export interface EmailOtpFormProps extends AuthFormBaseProps<AuthSuccess>, SendCaptchaProps, SecondFactorProps {
/**
* What the emailed code is for. Defaults to `"sign-in"`, the only purpose
* whose verification issues a session.
*/
readonly purpose?: EmailOtpPurpose
readonly labels?: Partial<EmailOtpLabels>
}
EmailOtpLabels (interface)
Every visible string EmailOtpForm renders.
Signature
export interface EmailOtpLabels extends Record<string, string> {
readonly email: string
readonly code: string
readonly sendSubmit: string
readonly sendPending: string
readonly verifySubmit: string
readonly verifyPending: string
/** Shown above the code field once the code has been sent. */
readonly sent: string
/** Button that returns to the email step. */
readonly restart: string
readonly sendError: string
readonly verifyError: string
}
MagicLinkFormProps (interface)
Signature
export interface MagicLinkFormProps extends AuthFormBaseProps<StatusResponse>, SendCaptchaProps {
readonly labels?: Partial<MagicLinkLabels>
}
MagicLinkLabels (interface)
Every visible string MagicLinkForm renders.
Signature
export interface MagicLinkLabels extends Record<string, string> {
readonly email: string
readonly submit: string
readonly submitPending: string
readonly success: string
readonly error: string
}
PasswordResetConfirmFormProps (interface)
Props for PasswordResetConfirmForm.
Signature
export interface PasswordResetConfirmFormProps extends AuthFormBaseProps<StatusResponse> {
/** The single-use token from the reset email, usually a URL query parameter. */
readonly token: string
readonly labels?: Partial<PasswordResetConfirmLabels>
}
PasswordResetConfirmLabels (interface)
Every visible string PasswordResetConfirmForm renders.
Signature
export interface PasswordResetConfirmLabels extends Record<string, string> {
readonly password: string
readonly confirmPassword: string
readonly submit: string
readonly submitPending: string
/** Client-side failure when the two password fields disagree. */
readonly mismatch: string
readonly success: string
readonly error: string
}
PasswordResetRequestFormProps (interface)
Props for PasswordResetRequestForm.
Signature
export interface PasswordResetRequestFormProps extends AuthFormBaseProps<StatusResponse>, SendCaptchaProps {
readonly labels?: Partial<PasswordResetRequestLabels>
}
PasswordResetRequestLabels (interface)
Every visible string PasswordResetRequestForm renders.
Signature
export interface PasswordResetRequestLabels extends Record<string, string> {
readonly email: string
readonly submit: string
readonly submitPending: string
/** Rendered in a `role="status"` element once the request succeeds. */
readonly success: string
readonly error: string
}
SecondFactorProps (interface)
The second-factor callback of the forms that sign in.
Signature
export interface SecondFactorProps {
/**
* Called instead of `onSuccess` when the server answers with a second-factor
* challenge (`202`): the account has multi-factor on and no session exists
* yet. Redeem the challenge with `client.multiFactor.continueChallenge`.
* Without it, such an answer calls neither callback.
*/
readonly onSecondFactor?: (challenge: SecondFactorChallenge) => void
}
SendCaptchaProps (interface)
The captcha token for a code or link send, read when the form submits. Pass it when the server’s CaptchaPlugin guards sends (its sendCode endpoint, on by default): render your captcha widget beside the form and return its current token, or None before it has one (the server then refuses the send). Omit it when sends are not captcha-guarded.
Signature
export interface SendCaptchaProps {
readonly captchaToken?: () => Option.Option<string>
}
SignInFormProps (interface)
Props for SignInForm.
Signature
export interface SignInFormProps extends AuthFormBaseProps<AuthSuccess>, SecondFactorProps {
/**
* Which identifier to sign in with. `"email"` (the default) calls
* `client.signIn`; `"username"` calls `client.signInUsername`, which the
* server only answers when the username module is configured.
*/
readonly variant?: "email" | "username"
readonly labels?: Partial<SignInLabels>
}
SignInLabels (interface)
Every visible string SignInForm renders.
Signature
export interface SignInLabels extends Record<string, string> {
readonly email: string
readonly username: string
readonly password: string
readonly submit: string
readonly submitPending: string
/** Shown when the server's error carries no message of its own. */
readonly error: string
}
SignUpFormProps (interface)
Props for SignUpForm.
Signature
export interface SignUpFormProps extends AuthFormBaseProps<AuthSuccess> {
/**
* Render the display-name field. On by default because the client's sign-up
* payload carries an optional `name`; a blank name is omitted from the
* request rather than sent as `""`.
*/
readonly showName?: boolean
readonly labels?: Partial<SignUpLabels>
}
SignUpLabels (interface)
Every visible string SignUpForm renders.
Signature
export interface SignUpLabels extends Record<string, string> {
readonly email: string
readonly password: string
readonly name: string
readonly submit: string
readonly submitPending: string
readonly error: string
}