Skip to content

Commit

Permalink
#61 Trim potential whitespace with retrieved CSRF token.
Browse files Browse the repository at this point in the history
  • Loading branch information
signalpoint committed Feb 24, 2017
1 parent 2f69ef7 commit d07caa5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/services/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,18 @@ function services_get_csrf_token(options) {
if (options.error) { options.error(token_request, token_request.status, token_request.responseText); }
}
else { // OK
// Set Drupal.sessid with the token, then return the token to the
// success function.
token = token_request.responseText;
// Set Drupal.sessid with the token, then return the token to the success function.
token = token_request.responseText.trim();
Drupal.sessid = token;
if (options.success) { options.success(token); }
}
}
else {
console.log(
'services_get_csrf_token - readyState - ' + token_request.readyState
);
console.log('services_get_csrf_token - readyState - ' + token_request.readyState);
}
}
catch (error) {
console.log(
'services_get_csrf_token - token_request. onload - ' + error
);
console.log('services_get_csrf_token - token_request. onload - ' + error);
}
};

Expand Down

0 comments on commit d07caa5

Please sign in to comment.