@pga/auth-flow-provider
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -6,6 +6,11 @@ # Change Log | ||
<a name="1.6.0"></a> | ||
# [1.6.0](https://github.com/pgahq/pga-common/compare/@pga/auth-flow-provider@0.0.5...@pga/auth-flow-provider@1.6.0) (2024-03-26) | ||
<a name="1.7.0"></a> | ||
# [1.7.0](https://github.com/pgahq/pga-common/compare/@pga/auth-flow-provider@0.0.5...@pga/auth-flow-provider@1.7.0) (2024-03-26) | ||
### Bug Fixes | ||
* **auth-flow-provider:** add checkSession call, remove unnecessary logout call in redirectCallback ([00123ef](https://github.com/pgahq/pga-common/commit/00123ef)) | ||
### Features | ||
@@ -12,0 +17,0 @@ |
@@ -92,16 +92,20 @@ (function (global, factory) { | ||
_context.next = 5; | ||
return _client2.default.checkSession(); | ||
case 5: | ||
_context.next = 7; | ||
return (0, _token.getToken)(); | ||
case 5: | ||
case 7: | ||
token = _context.sent; | ||
if (!(token != null)) { | ||
_context.next = 20; | ||
_context.next = 22; | ||
break; | ||
} | ||
_context.next = 9; | ||
_context.next = 11; | ||
return fetchCurrentUser(token); | ||
case 9: | ||
case 11: | ||
_ref2 = _context.sent; | ||
@@ -113,3 +117,3 @@ _ref3 = (0, _slicedToArray3.default)(_ref2, 2); | ||
if (!error) { | ||
_context.next = 15; | ||
_context.next = 17; | ||
break; | ||
@@ -120,3 +124,3 @@ } | ||
case 15: | ||
case 17: | ||
role = user.role; | ||
@@ -126,14 +130,14 @@ isLoggedIn = !(role && role === ANONYMOUS_ROLE); | ||
this.setState({ authReady: true, isLoggedIn: isLoggedIn, me: user }); | ||
_context.next = 21; | ||
_context.next = 23; | ||
break; | ||
case 20: | ||
case 22: | ||
this.setState({ authReady: true, isLoggedIn: false }); | ||
case 21: | ||
_context.next = 26; | ||
case 23: | ||
_context.next = 28; | ||
break; | ||
case 23: | ||
_context.prev = 23; | ||
case 25: | ||
_context.prev = 25; | ||
_context.t0 = _context['catch'](2); | ||
@@ -143,3 +147,3 @@ | ||
case 26: | ||
case 28: | ||
case 'end': | ||
@@ -149,3 +153,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[2, 23]]); | ||
}, _callee, this, [[2, 25]]); | ||
})); | ||
@@ -173,11 +177,6 @@ | ||
this.setState({ isRedirecting: true }); | ||
// clear any existing cached credentials | ||
_context2.next = 5; | ||
return _client2.default.logout({ openUrl: false }); | ||
return _client2.default.handleRedirectCallback(); | ||
case 5: | ||
_context2.next = 7; | ||
return _client2.default.handleRedirectCallback(); | ||
case 7: | ||
_ref5 = _context2.sent; | ||
@@ -189,7 +188,7 @@ appState = _ref5.appState; | ||
} | ||
_context2.next = 16; | ||
_context2.next = 14; | ||
break; | ||
case 12: | ||
_context2.prev = 12; | ||
case 10: | ||
_context2.prev = 10; | ||
_context2.t0 = _context2['catch'](1); | ||
@@ -200,3 +199,3 @@ | ||
case 16: | ||
case 14: | ||
case 'end': | ||
@@ -206,3 +205,3 @@ return _context2.stop(); | ||
} | ||
}, _callee2, this, [[1, 12]]); | ||
}, _callee2, this, [[1, 10]]); | ||
})); | ||
@@ -209,0 +208,0 @@ |
{ | ||
"name": "@pga/auth-flow-provider", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "PGA React Auth Provider Package", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -35,2 +35,3 @@ import React from 'react' | ||
try { | ||
await auth0.checkSession() | ||
const token = await getToken() | ||
@@ -56,4 +57,2 @@ if (token != null) { | ||
this.setState({ isRedirecting: true }) | ||
// clear any existing cached credentials | ||
await auth0.logout({ openUrl: false }) | ||
const { appState } = await auth0.handleRedirectCallback() | ||
@@ -60,0 +59,0 @@ if (appState && appState.returnTo) { |
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
88170
1976