Skip to content

Commit

Permalink
Additional logs for failed license key check
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp <philipp.koenig@redeviation.com>
  • Loading branch information
Kiuryy committed Dec 19, 2021
1 parent 483a3b9 commit 68013a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/js/background/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
this.checkLicenseKey(opts.licenseKey).then((response) => {
let returnData = {success: false};

if (response.valid === true) { // valid license key -> reinitialize sidebar
if (!!response.valid === true) { // valid license key -> reinitialize sidebar
returnData.success = true;

b.helper.model.setLicenseKey(opts.licenseKey).then((response) => {
Expand Down Expand Up @@ -99,11 +99,19 @@
}
}).then((xhr) => {
if (xhr.response && typeof xhr.response.valid !== "undefined") {
if (!xhr.response.valid) {
// eslint-disable-next-line no-console
console.error("License key check: Invalid key", licenseKey, xhr);
}
resolve({valid: xhr.response.valid});
} else {
// eslint-disable-next-line no-console
console.error("License key check: Invalid response", licenseKey, xhr);
resolve({valid: null});
}
}, () => {
}, (err) => {
// eslint-disable-next-line no-console
console.error("License key check: Request failed", licenseKey, err);
resolve({valid: null});
});
});
Expand Down

0 comments on commit 68013a5

Please sign in to comment.