Upgrade frontend-auth and conform to new signature of ensurePublicOrAuthenticationAndCookies.

This commit is contained in:
Douglas Hall
2019-04-10 15:43:57 -04:00
parent 343e4cb062
commit ff9ddb54ed
3 changed files with 46 additions and 24 deletions

47
package-lock.json generated
View File

@@ -2570,9 +2570,9 @@
}
},
"@edx/frontend-auth": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@edx/frontend-auth/-/frontend-auth-3.2.0.tgz",
"integrity": "sha512-FwOVde6/ZZWT5ZKe6pRqwR+TAV6ARjSTvDF/lt2EcIEyjG/ydRuC/QRYlamnSuODPqhq+414yKWGx4UvFWlxSw==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@edx/frontend-auth/-/frontend-auth-4.0.0.tgz",
"integrity": "sha512-nWbdq9c3WDzNyIA16MI9jRMaSbUn4lMUA1gLi1xmxxviR9Kppm6Ne6vZpCpo0p18X2kcWsfEnEprTfRg1i+5Ew==",
"requires": {
"axios": "^0.18.0",
"camelcase-keys": "^5.0.0",
@@ -10407,7 +10407,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -10428,12 +10429,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -10448,17 +10451,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -10575,7 +10581,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -10587,6 +10594,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -10601,6 +10609,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -10608,12 +10617,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -10632,6 +10643,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -10712,7 +10724,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -10724,6 +10737,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -10809,7 +10823,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -10845,6 +10860,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -10864,6 +10880,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -10907,12 +10924,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

View File

@@ -27,7 +27,7 @@
"@cospired/i18n-iso-languages": "^2.0.2",
"@edx/edx-bootstrap": "git://github.com/edx/edx-bootstrap.git#update-with-documentation-site",
"@edx/frontend-analytics": "^1.0.0",
"@edx/frontend-auth": "^3.2.0",
"@edx/frontend-auth": "^4.0.0",
"@edx/frontend-component-footer": "^2.0.3",
"@edx/frontend-component-site-header": "^2.1.4",
"@edx/frontend-logging": "^1.0.0",

View File

@@ -13,15 +13,18 @@ import './index.scss';
import App from './components/App';
if (apiClient.ensurePublicOrAuthencationAndCookies(window.location.pathname)) {
const { store, history } = configureStore();
apiClient.ensurePublicOrAuthenticationAndCookies(
window.location.pathname,
() => {
const { store, history } = configureStore();
if (process.env.NODE_ENV === 'production') {
handleRtl();
}
if (process.env.NODE_ENV === 'production') {
handleRtl();
}
ReactDOM.render(<App store={store} history={history} />, document.getElementById('root'));
ReactDOM.render(<App store={store} history={history} />, document.getElementById('root'));
identifyAuthenticatedUser();
sendPageEvent();
}
identifyAuthenticatedUser();
sendPageEvent();
},
);