@folklore/forms
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -56,4 +56,6 @@ 'use strict'; | ||
getFieldValue = null, | ||
onComplete = null | ||
} = opts; | ||
onComplete = null, | ||
csrfTokenName = null, | ||
xsrfTokenName = null | ||
} = opts || {}; | ||
const [stateValue, setStateValue] = react.useState(initialValue || providedValue); | ||
@@ -123,4 +125,4 @@ const [stateErrors, setStateErrors] = react.useState(initialErrors || providedErrors); | ||
credentials: 'include', | ||
headers: fetch.getCSRFHeaders() | ||
}), [postForm, fetch.postJSON, fetch.getCSRFHeaders]); | ||
headers: fetch.getCSRFHeaders(csrfTokenName, xsrfTokenName) | ||
}), [postForm, fetch.postJSON, fetch.getCSRFHeaders, csrfTokenName, xsrfTokenName]); | ||
const submit = react.useCallback(function () { | ||
@@ -127,0 +129,0 @@ let submitValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value; |
@@ -47,4 +47,6 @@ import { getCsrfToken, postJSON, getCSRFHeaders } from '@folklore/fetch'; | ||
getFieldValue = null, | ||
onComplete = null | ||
} = opts; | ||
onComplete = null, | ||
csrfTokenName = null, | ||
xsrfTokenName = null | ||
} = opts || {}; | ||
const [stateValue, setStateValue] = useState(initialValue || providedValue); | ||
@@ -114,4 +116,4 @@ const [stateErrors, setStateErrors] = useState(initialErrors || providedErrors); | ||
credentials: 'include', | ||
headers: getCSRFHeaders() | ||
}), [postForm, postJSON, getCSRFHeaders]); | ||
headers: getCSRFHeaders(csrfTokenName, xsrfTokenName) | ||
}), [postForm, postJSON, getCSRFHeaders, csrfTokenName, xsrfTokenName]); | ||
const submit = useCallback(function () { | ||
@@ -118,0 +120,0 @@ let submitValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value; |
{ | ||
"name": "@folklore/forms", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Forms utilities", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"@babel/runtime": "^7.4.3", | ||
"@folklore/fetch": "^0.1.17", | ||
"@folklore/fetch": "^0.1.18", | ||
"lodash": "^4.17.4" | ||
@@ -55,3 +55,3 @@ }, | ||
}, | ||
"gitHead": "ebe66bb082229ac829cbbdc5054cf0e7bbce9460" | ||
"gitHead": "299c4d804aaa15455627b5ae353d3936da9fd692" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11939
319
6
Updated@folklore/fetch@^0.1.18