@pga/auth-flow-provider
Advanced tools
Comparing version 0.0.1-1 to 0.0.1-2
@@ -43,2 +43,3 @@ (function (global, factory) { | ||
var ANONYMOUS_ROLE = 'ANONYMOUS'; | ||
var SESSION_TIMEOUT_CHECK = 2 * 60 * 1000; | ||
@@ -60,2 +61,5 @@ var AuthContext = _react2.default.createContext(); | ||
_this.state = { authReady: false, isLoggedIn: false, me: null }; | ||
_this.sessionTimedId = null; | ||
_this.fetchSession = _this.fetchSession.bind(_this); | ||
return _this; | ||
@@ -65,3 +69,3 @@ } | ||
(0, _createClass3.default)(AuthFlowProvider, [{ | ||
key: 'componentDidMount', | ||
key: 'fetchSession', | ||
value: function () { | ||
@@ -139,9 +143,58 @@ var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() { | ||
function componentDidMount() { | ||
function fetchSession() { | ||
return _ref.apply(this, arguments); | ||
} | ||
return fetchSession; | ||
}() | ||
}, { | ||
key: 'componentDidMount', | ||
value: function () { | ||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() { | ||
return _regenerator2.default.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
_context2.prev = 0; | ||
_context2.next = 3; | ||
return this.fetchSession(); | ||
case 3: | ||
_context2.next = 8; | ||
break; | ||
case 5: | ||
_context2.prev = 5; | ||
_context2.t0 = _context2['catch'](0); | ||
console.log(_context2.t0); | ||
case 8: | ||
this.sessionTimedId = setTimeout(this.fetchSession, SESSION_TIMEOUT_CHECK); | ||
console.log('this.sessionTimedId: ', this.sessionTimedId); | ||
case 10: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee2, this, [[0, 5]]); | ||
})); | ||
function componentDidMount() { | ||
return _ref5.apply(this, arguments); | ||
} | ||
return componentDidMount; | ||
}() | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this.sessionTimedId) { | ||
clearTimeout(this.sessionTimedId); | ||
} | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -148,0 +201,0 @@ value: function render() { |
{ | ||
"name": "@pga/auth-flow-provider", | ||
"version": "0.0.1-1", | ||
"version": "0.0.1-2", | ||
"description": "PGA React Auth Provider Package for OneLogin's Authorization Flow", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31759
693