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