dropkiq
Version:
Liquid Expressions Simplified
1 lines • 873 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var axios=require("axios"),Authorizer=function(){function e(e){void 0===e&&(e=""),this.licenseKey=e,this.domainName=window.location.hostname,this.response={},this.bypassKeys=["894f2a10-3b3f-013b-0a85-4a36325215e0"]}return e.prototype.authorized=function(){return!!this.bypassKeys.includes(this.licenseKey)||this.response&&this.response.data&&this.response.data.authorized},e.prototype.authorize=function(){if(this.bypassKeys.includes(this.licenseKey))return!0;var e=this;axios({method:"POST",url:"https://app.dropkiq.com/authorization_attempts",headers:{"Access-Control-Allow-Origin":"*"},data:{domain_name:this.domainName,license_key:this.licenseKey}}).then((function(t){e.response=t})).catch((function(e){throw new Error("Unable to authenticate with dropkiq.com")}))},e}();exports.Authorizer=Authorizer;