Skip to main content

OnSubmitHandlerProps<T>

type OnSubmitHandlerProps<T> = {
body: T
onError?: OryErrorHandler
onRedirect: OnRedirectHandler
onSuccess?: OrySuccessHandler
onValidationError?: OryValidationErrorHandler
setFlowContainer: (flowContainer: OryFlowContainer) => void
}

Props for the submit handler

Type Parameters

Type Parameter
T extends | UpdateLoginFlowBody | UpdateRegistrationFlowBody | UpdateVerificationFlowBody | UpdateRecoveryFlowBody | UpdateSettingsFlowBody

Properties

body

body: T

The form values to submit.


onError?

optional onError: OryErrorHandler;

Optional callback invoked on infrastructure or flow-level errors (expired flow, CSRF, not found, replaced). Awaited if it returns a Promise.


onRedirect

onRedirect: OnRedirectHandler

This method is used to redirect the user to a different page.


onSuccess?

optional onSuccess: OrySuccessHandler;

Optional callback invoked after a successful submission, before the default behavior (redirect, flow update). Awaited if it returns a Promise.


onValidationError?

optional onValidationError: OryValidationErrorHandler;

Optional callback invoked when the server returns validation errors. Awaited if it returns a Promise.


setFlowContainer()

setFlowContainer: (flowContainer: OryFlowContainer) => void;

This method is used to update the flow container when a validation error occurs, for example.

Parameters

ParameterType
flowContainerOryFlowContainer

Returns

void