Skip to main content
1 of 2
Amin
  • 64
  • 4

If you're certain the token exists in either of the objects you can do:

First check for the existence of the value in data.

var value = data.d || data.value;

then access the value to get the token

var token = value && value.GetContextWebInformation.FormDigestValue;

var value = data.d || data.value;

var token = value && value.GetContextWebInformation.FormDigestValue;


if (token) {
  this.options.token = token;
}

Amin
  • 64
  • 4