import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/createClass";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/regenerator";import i from"auth0-js";function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var s=new(r((function r(){var c,s=this;t(this,r),n(this,"configure",(function(e){var r=process.env.REACT_APP_AUTH0_REDIRECT_URI||e.redirectUri||"";s.handler=new i.WebAuth(a(a({},e),{},{redirectUri:r}))})),n(this,"authorize",(c=e(o.mark((function e(r){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.handler.authorize({connection:r});case 1:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)})),n(this,"authenticate",e(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){s.handler.parseHash((function(t,n){t?r(new Error(t)):e(n.accessToken)}))})));case 1:case"end":return e.stop()}}),e)}))))})));export{s as provider};
//# sourceMappingURL=auth0.js.map
