@widergy/react-social-auth 1.2.1 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +1,31 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.NoHashOrQueryParamsError = exports.GetAuthTokenFailure = exports.PopupClosedByUserError = exports.RequestTokenParseError = exports.RequestTokenError = void 0;
9
-
7
+ exports.RequestTokenParseError = exports.RequestTokenError = exports.PopupClosedByUserError = exports.NoHashOrQueryParamsError = exports.GetAuthTokenFailure = void 0;
8
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
-
12
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
-
13
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
-
16
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
17
-
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
16
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
-
20
17
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
21
-
22
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
23
-
18
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
24
19
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
-
26
20
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
27
-
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
-
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
31
-
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
23
  var RequestTokenError = /*#__PURE__*/function (_Error) {
33
24
  _inherits(RequestTokenError, _Error);
34
-
35
25
  var _super = _createSuper(RequestTokenError);
36
-
37
26
  function RequestTokenError(error) {
38
27
  var _this;
39
-
40
28
  _classCallCheck(this, RequestTokenError);
41
-
42
29
  _this = _super.call(this);
43
30
  _this.message = 'Unable to retrieve OAuth Token';
44
31
  _this.name = 'Fatal Error';
@@ -46,22 +33,15 @@ var RequestTokenError = /*#__PURE__*/function (_Error) {
46
33
  _this.error = error;
47
34
  return _this;
48
35
  }
49
-
50
- return RequestTokenError;
36
+ return _createClass(RequestTokenError);
51
37
  }( /*#__PURE__*/_wrapNativeSuper(Error));
52
-
53
38
  exports.RequestTokenError = RequestTokenError;
54
-
55
39
  var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
56
40
  _inherits(RequestTokenParseError, _Error2);
57
-
58
41
  var _super2 = _createSuper(RequestTokenParseError);
59
-
60
42
  function RequestTokenParseError(error) {
61
43
  var _this2;
62
-
63
44
  _classCallCheck(this, RequestTokenParseError);
64
-
65
45
  _this2 = _super2.call(this);
66
46
  _this2.message = 'Unable to parse JSON from response';
67
47
  _this2.name = 'Fatal Error';
@@ -69,44 +49,30 @@ var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
69
49
  _this2.error = error;
70
50
  return _this2;
71
51
  }
72
-
73
- return RequestTokenParseError;
52
+ return _createClass(RequestTokenParseError);
74
53
  }( /*#__PURE__*/_wrapNativeSuper(Error));
75
-
76
54
  exports.RequestTokenParseError = RequestTokenParseError;
77
-
78
55
  var PopupClosedByUserError = /*#__PURE__*/function (_Error3) {
79
56
  _inherits(PopupClosedByUserError, _Error3);
80
-
81
57
  var _super3 = _createSuper(PopupClosedByUserError);
82
-
83
58
  function PopupClosedByUserError() {
84
59
  var _this3;
85
-
86
60
  _classCallCheck(this, PopupClosedByUserError);
87
-
88
61
  _this3 = _super3.call(this);
89
62
  _this3.message = 'Popup has been closed by user';
90
63
  _this3.name = 'Info';
91
64
  _this3.stack = '';
92
65
  return _this3;
93
66
  }
94
-
95
- return PopupClosedByUserError;
67
+ return _createClass(PopupClosedByUserError);
96
68
  }( /*#__PURE__*/_wrapNativeSuper(Error));
97
-
98
69
  exports.PopupClosedByUserError = PopupClosedByUserError;
99
-
100
70
  var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
101
71
  _inherits(GetAuthTokenFailure, _Error4);
102
-
103
72
  var _super4 = _createSuper(GetAuthTokenFailure);
104
-
105
73
  function GetAuthTokenFailure(error, url, verifier, token) {
106
74
  var _this4;
107
-
108
75
  _classCallCheck(this, GetAuthTokenFailure);
109
-
110
76
  _this4 = _super4.call(this);
111
77
  _this4.message = "Unable to retrieve Authorization Token from ".concat(url, "\n OAuth Verifier: ").concat(verifier, " \n OAuth Token: ").concat(token, " ");
112
78
  _this4.name = 'Fatal Error';
@@ -114,30 +80,21 @@ var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
114
80
  _this4.error = error;
115
81
  return _this4;
116
82
  }
117
-
118
- return GetAuthTokenFailure;
83
+ return _createClass(GetAuthTokenFailure);
119
84
  }( /*#__PURE__*/_wrapNativeSuper(Error));
120
-
121
85
  exports.GetAuthTokenFailure = GetAuthTokenFailure;
122
-
123
86
  var NoHashOrQueryParamsError = /*#__PURE__*/function (_Error5) {
124
87
  _inherits(NoHashOrQueryParamsError, _Error5);
125
-
126
88
  var _super5 = _createSuper(NoHashOrQueryParamsError);
127
-
128
89
  function NoHashOrQueryParamsError() {
129
90
  var _this5;
130
-
131
91
  _classCallCheck(this, NoHashOrQueryParamsError);
132
-
133
92
  _this5 = _super5.call(this);
134
93
  _this5.message = "OAuth redirect has occurred but no query or hash parameters were found.\n They were either not set during the redirect, or were removed\u2014typically by a\n routing library\u2014before Twitter react component could read it.";
135
94
  _this5.name = 'Fatal Error';
136
95
  _this5.stack = '';
137
96
  return _this5;
138
97
  }
139
-
140
- return NoHashOrQueryParamsError;
98
+ return _createClass(NoHashOrQueryParamsError);
141
99
  }( /*#__PURE__*/_wrapNativeSuper(Error));
142
-
143
100
  exports.NoHashOrQueryParamsError = NoHashOrQueryParamsError;
@@ -1,55 +1,44 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
7
-
8
8
  var _react = _interopRequireDefault(require("react"));
9
-
10
9
  var _propTypes = require("prop-types");
11
-
12
10
  require("url-search-params-polyfill");
13
-
14
11
  var _function = require("@widergy/web-utils/lib/function");
15
-
16
12
  var _twitter = require("./assets/twitter.svg");
17
-
18
13
  var _utils = require("./utils");
19
-
20
14
  var _errors = require("./errors");
21
-
22
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
16
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
24
17
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
25
-
26
18
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
27
-
28
19
  var TwitterLogin = function TwitterLogin(_ref) {
29
20
  var screenName = _ref.screenName,
30
- requestTokenUrl = _ref.requestTokenUrl,
31
- credentials = _ref.credentials,
32
- loginUrl = _ref.loginUrl,
33
- onFailure = _ref.onFailure,
34
- onSuccess = _ref.onSuccess,
35
- customHeaders = _ref.customHeaders,
36
- dialogWidth = _ref.dialogWidth,
37
- dialogHeight = _ref.dialogHeight,
38
- disabled = _ref.disabled,
39
- text = _ref.text,
40
- style = _ref.style,
41
- showIcon = _ref.showIcon,
42
- className = _ref.className,
43
- forceLogin = _ref.forceLogin,
44
- children = _ref.children;
45
-
21
+ requestTokenUrl = _ref.requestTokenUrl,
22
+ credentials = _ref.credentials,
23
+ loginUrl = _ref.loginUrl,
24
+ onFailure = _ref.onFailure,
25
+ onSuccess = _ref.onSuccess,
26
+ customHeaders = _ref.customHeaders,
27
+ dialogWidth = _ref.dialogWidth,
28
+ dialogHeight = _ref.dialogHeight,
29
+ disabled = _ref.disabled,
30
+ text = _ref.text,
31
+ style = _ref.style,
32
+ showIcon = _ref.showIcon,
33
+ className = _ref.className,
34
+ forceLogin = _ref.forceLogin,
35
+ children = _ref.children;
46
36
  var handleUrlChange = function handleUrlChange(popup) {
47
37
  var interval = (0, _function.polling)(function () {
48
38
  if (!popup || popup.closed || popup.closed === undefined) {
49
39
  clearInterval(interval);
50
40
  onFailure(new _errors.PopupClosedByUserError());
51
41
  }
52
-
53
42
  try {
54
43
  if (popup.location.hostname !== '' && !(0, _utils.isTwitterUrl)(popup.location.hostname)) {
55
44
  if (popup.location.search) {
@@ -60,48 +49,40 @@ var TwitterLogin = function TwitterLogin(_ref) {
60
49
  } else {
61
50
  onFailure(new _errors.NoHashOrQueryParamsError());
62
51
  }
63
-
64
52
  (0, _utils.closePopup)(interval, popup);
65
53
  }
66
- } catch (error) {// Ignore DOMException: Blocked a frame with origin from accessing a cross-origin frame.
54
+ } catch (error) {
55
+ // Ignore DOMException: Blocked a frame with origin from accessing a cross-origin frame.
67
56
  // A hack to get around same-origin security policy errors in IE.
68
57
  }
69
58
  }, 0);
70
59
  };
71
-
72
60
  var authenticate = /*#__PURE__*/function () {
73
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
61
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
74
62
  var authUrl, popup;
75
- return regeneratorRuntime.wrap(function _callee$(_context) {
76
- while (1) {
77
- switch (_context.prev = _context.next) {
78
- case 0:
79
- _context.next = 2;
80
- return (0, _utils.getAuthUrl)(requestTokenUrl, customHeaders, onFailure, screenName, credentials, forceLogin);
81
-
82
- case 2:
83
- authUrl = _context.sent;
84
- popup = (0, _utils.openPopup)(authUrl, dialogWidth, dialogHeight);
85
- handleUrlChange(popup);
86
-
87
- case 5:
88
- case "end":
89
- return _context.stop();
90
- }
63
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
64
+ while (1) switch (_context.prev = _context.next) {
65
+ case 0:
66
+ _context.next = 2;
67
+ return (0, _utils.getAuthUrl)(requestTokenUrl, customHeaders, onFailure, screenName, credentials, forceLogin);
68
+ case 2:
69
+ authUrl = _context.sent;
70
+ popup = (0, _utils.openPopup)(authUrl, dialogWidth, dialogHeight);
71
+ handleUrlChange(popup);
72
+ case 5:
73
+ case "end":
74
+ return _context.stop();
91
75
  }
92
76
  }, _callee);
93
77
  }));
94
-
95
78
  return function authenticate() {
96
79
  return _ref2.apply(this, arguments);
97
80
  };
98
81
  }();
99
-
100
82
  var handleClick = function handleClick(event) {
101
83
  event.preventDefault();
102
84
  return authenticate();
103
85
  };
104
-
105
86
  var getDefaultButtonContent = function getDefaultButtonContent() {
106
87
  var defaultIcon = showIcon ? /*#__PURE__*/_react.default.createElement(_twitter.ReactComponent, {
107
88
  color: "#00aced",
@@ -109,7 +90,6 @@ var TwitterLogin = function TwitterLogin(_ref) {
109
90
  }) : null;
110
91
  return /*#__PURE__*/_react.default.createElement("span", null, defaultIcon, " ", text);
111
92
  };
112
-
113
93
  return /*#__PURE__*/_react.default.createElement("tag", {
114
94
  onClick: handleClick,
115
95
  style: style,
@@ -117,7 +97,6 @@ var TwitterLogin = function TwitterLogin(_ref) {
117
97
  className: className
118
98
  }, children || getDefaultButtonContent());
119
99
  };
120
-
121
100
  TwitterLogin.propTypes = {
122
101
  text: _propTypes.string,
123
102
  loginUrl: _propTypes.string.isRequired,
@@ -3,101 +3,79 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getAuthToken = exports.closePopup = exports.openPopup = exports.isTwitterUrl = exports.getAuthUrl = exports.createHeaders = void 0;
7
-
6
+ exports.openPopup = exports.isTwitterUrl = exports.getAuthUrl = exports.getAuthToken = exports.createHeaders = exports.closePopup = void 0;
8
7
  var _errors = require("./errors");
9
-
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
10
10
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
-
12
11
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
17
  var createHeaders = function createHeaders(customHeaders) {
21
18
  var headers = _objectSpread({}, customHeaders);
22
-
23
19
  headers['Content-Type'] = 'application/json';
24
20
  return headers;
25
21
  };
26
-
27
22
  exports.createHeaders = createHeaders;
28
-
29
23
  var getAuthUrl = /*#__PURE__*/function () {
30
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(requestTokenUrl, customHeaders, onFailure, screenName, credentials, forceLogin) {
24
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(requestTokenUrl, customHeaders, onFailure, screenName, credentials, forceLogin) {
31
25
  var response, data, authenticationUrl;
32
- return regeneratorRuntime.wrap(function _callee$(_context) {
33
- while (1) {
34
- switch (_context.prev = _context.next) {
35
- case 0:
36
- response = null;
37
- _context.prev = 1;
38
- _context.next = 4;
39
- return window.fetch(requestTokenUrl, {
40
- method: 'POST',
41
- credentials: credentials,
42
- headers: createHeaders(customHeaders)
43
- });
44
-
45
- case 4:
46
- response = _context.sent;
47
- _context.next = 10;
48
- break;
49
-
50
- case 7:
51
- _context.prev = 7;
52
- _context.t0 = _context["catch"](1);
53
- return _context.abrupt("return", onFailure(new _errors.RequestTokenError(_context.t0)));
54
-
55
- case 10:
56
- data = null;
57
- _context.prev = 11;
58
- _context.next = 14;
59
- return response.json();
60
-
61
- case 14:
62
- data = _context.sent;
63
- _context.next = 20;
64
- break;
65
-
66
- case 17:
67
- _context.prev = 17;
68
- _context.t1 = _context["catch"](11);
69
- return _context.abrupt("return", onFailure(new _errors.RequestTokenParseError(_context.t1)));
70
-
71
- case 20:
72
- authenticationUrl = "https://api.twitter.com/oauth/authenticate?oauth_token=".concat(data.oauth_token, "&force_login=").concat(forceLogin);
73
-
74
- if (screenName) {
75
- authenticationUrl = "".concat(authenticationUrl, "&screen_name=").concat(screenName);
76
- }
77
-
78
- return _context.abrupt("return", authenticationUrl);
79
-
80
- case 23:
81
- case "end":
82
- return _context.stop();
83
- }
26
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
27
+ while (1) switch (_context.prev = _context.next) {
28
+ case 0:
29
+ response = null;
30
+ _context.prev = 1;
31
+ _context.next = 4;
32
+ return window.fetch(requestTokenUrl, {
33
+ method: 'POST',
34
+ credentials: credentials,
35
+ headers: createHeaders(customHeaders)
36
+ });
37
+ case 4:
38
+ response = _context.sent;
39
+ _context.next = 10;
40
+ break;
41
+ case 7:
42
+ _context.prev = 7;
43
+ _context.t0 = _context["catch"](1);
44
+ return _context.abrupt("return", onFailure(new _errors.RequestTokenError(_context.t0)));
45
+ case 10:
46
+ data = null;
47
+ _context.prev = 11;
48
+ _context.next = 14;
49
+ return response.json();
50
+ case 14:
51
+ data = _context.sent;
52
+ _context.next = 20;
53
+ break;
54
+ case 17:
55
+ _context.prev = 17;
56
+ _context.t1 = _context["catch"](11);
57
+ return _context.abrupt("return", onFailure(new _errors.RequestTokenParseError(_context.t1)));
58
+ case 20:
59
+ authenticationUrl = "https://api.twitter.com/oauth/authenticate?oauth_token=".concat(data.oauth_token, "&force_login=").concat(forceLogin);
60
+ if (screenName) {
61
+ authenticationUrl = "".concat(authenticationUrl, "&screen_name=").concat(screenName);
62
+ }
63
+ return _context.abrupt("return", authenticationUrl);
64
+ case 23:
65
+ case "end":
66
+ return _context.stop();
84
67
  }
85
68
  }, _callee, null, [[1, 7], [11, 17]]);
86
69
  }));
87
-
88
70
  return function getAuthUrl(_x, _x2, _x3, _x4, _x5, _x6) {
89
71
  return _ref.apply(this, arguments);
90
72
  };
91
73
  }();
92
-
93
74
  exports.getAuthUrl = getAuthUrl;
94
-
95
75
  var isTwitterUrl = function isTwitterUrl(url) {
96
76
  return url.includes('api.twitter.com');
97
77
  };
98
-
99
78
  exports.isTwitterUrl = isTwitterUrl;
100
-
101
79
  var openPopup = function openPopup(authUrl, width, height) {
102
80
  var w = width;
103
81
  var h = height;
@@ -106,16 +84,12 @@ var openPopup = function openPopup(authUrl, width, height) {
106
84
  var popup = window.open(authUrl, '', "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=".concat(w, ", height=").concat(h, ", top=").concat(top, ", left=").concat(left));
107
85
  return popup;
108
86
  };
109
-
110
87
  exports.openPopup = openPopup;
111
-
112
88
  var closePopup = function closePopup(interval, popup) {
113
89
  clearInterval(interval);
114
90
  popup.close();
115
91
  };
116
-
117
92
  exports.closePopup = closePopup;
118
-
119
93
  var getAuthToken = function getAuthToken(OAuthVerifier, OAuthToken, loginUrl, credentials, onSuccess, onFailure, customHeaders) {
120
94
  return window.fetch("".concat(loginUrl, "?oauth_verifier=").concat(OAuthVerifier, "&oauth_token=").concat(OAuthToken), {
121
95
  method: 'POST',
@@ -127,5 +101,4 @@ var getAuthToken = function getAuthToken(OAuthVerifier, OAuthToken, loginUrl, cr
127
101
  return onFailure(new _errors.GetAuthTokenFailure(error, loginUrl, OAuthVerifier, OAuthToken));
128
102
  });
129
103
  };
130
-
131
104
  exports.getAuthToken = getAuthToken;
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Twitter", {
6
+ Object.defineProperty(exports, "ActiveDirectory", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _Twitter.default;
9
+ return _ActiveDirectory.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "Apple", {
@@ -15,25 +15,20 @@ Object.defineProperty(exports, "Apple", {
15
15
  return _Apple.default;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "initAppleAuth", {
18
+ Object.defineProperty(exports, "Twitter", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _utils.initAppleAuth;
21
+ return _Twitter.default;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "ActiveDirectory", {
24
+ Object.defineProperty(exports, "initAppleAuth", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _ActiveDirectory.default;
27
+ return _utils.initAppleAuth;
28
28
  }
29
29
  });
30
-
31
30
  var _Twitter = _interopRequireDefault(require("./components/Twitter"));
32
-
33
31
  var _Apple = _interopRequireDefault(require("./components/Apple"));
34
-
35
32
  var _utils = require("./components/Apple/utils");
36
-
37
33
  var _ActiveDirectory = _interopRequireDefault(require("./components/ActiveDirectory"));
38
-
39
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/react-social-auth",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Social Network Authorization (Twitter, Facebook, etc.)",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -59,8 +59,8 @@
59
59
  "dependencies": {
60
60
  "@azure/msal-browser": "^2.12.0",
61
61
  "@widergy/web-utils": "^1.5.0",
62
- "node-sass": "^4.11.0",
63
- "sass-loader": "^7.1.0"
62
+ "node-sass": "^8.0.0",
63
+ "sass-loader": "^10.0.5"
64
64
  },
65
65
  "husky": {
66
66
  "hooks": {
package/CHANGELOG.md DELETED
@@ -1,41 +0,0 @@
1
- ## [1.2.1](https://github.com/widergy/react-social-auth/compare/v1.2.0...v1.2.1) (2021-04-08)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * ad login fix ([#8](https://github.com/widergy/react-social-auth/issues/8)) ([95d7964](https://github.com/widergy/react-social-auth/commit/95d79643f500c4a531e430cb5980e10dc1164c06))
7
-
8
- # [1.2.0](https://github.com/widergy/react-social-auth/compare/v1.1.2...v1.2.0) (2021-04-08)
9
-
10
-
11
- ### Features
12
-
13
- * active directory login ([#7](https://github.com/widergy/react-social-auth/issues/7)) ([b1a8cc5](https://github.com/widergy/react-social-auth/commit/b1a8cc5d9a19eb15a3518eee4d0276d1109d49f4))
14
-
15
- ## [1.1.2](https://github.com/widergy/react-social-auth/compare/v1.1.1...v1.1.2) (2020-09-11)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * Apple component can now take non default src ([#6](https://github.com/widergy/react-social-auth/issues/6)) ([2115581](https://github.com/widergy/react-social-auth/commit/2115581cf52cd062dba4c20619ff51513bdc374d))
21
-
22
- ## [1.1.1](https://github.com/widergy/react-social-auth/compare/v1.1.0...v1.1.1) (2020-07-29)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * Finished apple log in ([#5](https://github.com/widergy/react-social-auth/issues/5)) ([987645d](https://github.com/widergy/react-social-auth/commit/987645db8344dd546ddb2f15cddc2efdc3483624))
28
-
29
- # [1.1.0](https://github.com/widergy/react-social-auth/compare/v1.0.0...v1.1.0) (2020-07-24)
30
-
31
-
32
- ### Features
33
-
34
- * added apple log in ([#4](https://github.com/widergy/react-social-auth/issues/4)) ([3125a94](https://github.com/widergy/react-social-auth/commit/3125a9490923f925364b19e39fd1a7b68c284b0c))
35
-
36
- # 1.0.0 (2019-12-18)
37
-
38
-
39
- ### Features
40
-
41
- * added twitter auth ([#3](https://github.com/widergy/react-social-auth/issues/3)) ([5123a17](https://github.com/widergy/react-social-auth/commit/5123a17fab4ba7a4f461e56b78dfd4dbe58bf935))