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