convert csrfToken constan variable
This commit is contained in:
@@ -1,11 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Fetches CSRF Token from page
|
* Fetches CSRF Token from page
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
function getCSRFToken() {
|
const csrfToken = { 'X-XSRF-TOKEN': document.getElementsByName('__RequestVerificationToken')[0].value };
|
||||||
const token = document.getElementsByName('__RequestVerificationToken')[0].value
|
|
||||||
return { 'X-XSRF-TOKEN': token }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save signature data to server
|
* Save signature data to server
|
||||||
@@ -13,7 +9,7 @@ function getCSRFToken() {
|
|||||||
* @param {any} annotations
|
* @param {any} annotations
|
||||||
*/
|
*/
|
||||||
function postEnvelope(envelopeKey, annotations) {
|
function postEnvelope(envelopeKey, annotations) {
|
||||||
const token = getCSRFToken()
|
const token = csrfToken
|
||||||
const options = {
|
const options = {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user