← All changes
|
src/DonationForms/resources/app/utilities/handleValidationRequest.ts
+3
-1
4.16.2
→
4.18.0
View file →
| @@ -5,10 +5,12 @@ | ||
| 5 | 5 | import {__} from '@wordpress/i18n'; |
| 6 | 6 | import {FieldValues, UseFormSetError} from 'react-hook-form'; |
| 7 | 7 | import postFormData from '@givewp/forms/app/utilities/postFormData'; |
| 8 | 8 | import convertValuesToFormData from '@givewp/forms/app/utilities/convertValuesToFormData'; |
| 9 | +import {getAuthToken} from '@givewp/forms/app/utilities/authToken'; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 12 | + * @since 4.17.0 Send the auth token so embedded forms stay signed in without cookies | |
| 11 | 13 | * @since 3.0.0 |
| 12 | 14 | */ |
| 13 | 15 | export default async function handleValidationRequest( |
| 14 | 16 | validateUrl: string, |
| @@ -25,9 +27,9 @@ | ||
| 25 | 27 | }); |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | 30 | try { |
| 29 | - const formData = convertValuesToFormData(values); | |
| 31 | + const formData = convertValuesToFormData({...values, authToken: getAuthToken()}); | |
| 30 | 32 | |
| 31 | 33 | const {response} = await postFormData(validateUrl, formData); |
| 32 | 34 | |
| 33 | 35 | const formResponse = await response.json(); |