React promotes the use of Controlled components. This let's React play its helpful role as the source-of-truth. Components that make use of <Form> elements should use React-state to control the value of the form's inputs. The form submit functionality should similarly be controlled from the scope of React; bypassing the browser's default functionality.
The Kratos SDK should be used to simulate the submitted. Its completeRegistrationForPasswordMethod (or similar) functions should be used to send the request used to validate the user's credentials. Where the following arguments correlate with:
flow the user's flowId as returned through the URL query.
payload the user's credentials, entered in form inputs stored in React's state.
options configuration to indicate to Kratos that the request originated in a browser.
headers.Content-Type = application/x-www-form-urlencoded
React promotes the use of Controlled components. This let's React play its helpful role as the source-of-truth. Components that make use of
<Form>elements should use React-state to control the value of the form'sinputs. The formsubmitfunctionality should similarly be controlled from the scope of React; bypassing the browser's default functionality.The Kratos SDK should be used to simulate the submitted. Its
completeRegistrationForPasswordMethod(or similar) functions should be used to send the request used to validate the user's credentials. Where the following arguments correlate with:flowthe user'sflowIdas returned through the URL query.payloadthe user's credentials, entered in form inputs stored in React's state.optionsconfiguration to indicate to Kratos that the request originated in a browser.headers.Content-Type = application/x-www-form-urlencoded