Skip to content

Commit

Permalink
Merge branch 'fix/login-on-chrome'
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjalava committed Feb 17, 2021
2 parents b887380 + 2d506da commit f1c2a49
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/sizeme-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class FitRequest {
function createRequest (method, { token, withCredentials, body } = {}) {
const headers = new Headers({
"X-Sizeme-Pluginversion": pluginVersion,
"X-Analytics-Enabled": true
"X-Analytics-Enabled": true,
"Accept": "application/json",
"Csrf-Token": "nocheck"
});

if (token) {
Expand Down Expand Up @@ -137,8 +139,8 @@ function jsonResponse (response) {
return js;
}

if (js.message) {
throw new ApiError(js.message, response);
if (js.error) {
throw new ApiError(js.error.message, response);
} else {
throw new ApiError(`${response.status} - ${response.statusText || "N/A"}`, response);
}
Expand Down

0 comments on commit f1c2a49

Please sign in to comment.