From b7a04bcb89da90a63bc46b0c5abe2bfe454171d0 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Mon, 15 Jun 2020 19:02:18 -0400 Subject: [PATCH 1/3] improvement(example): Move Auth0Provider plumbing out of example.js and to ConnectedRouter. --- example.js | 70 +++++-------------------- lib/components/app/app-nav.js | 25 +++++---- lib/components/app/responsive-webapp.js | 33 ++++++++++-- lib/index.js | 2 + lib/util/auth.js | 8 +-- 5 files changed, 65 insertions(+), 73 deletions(-) diff --git a/example.js b/example.js index 086eddcff..94cce701e 100644 --- a/example.js +++ b/example.js @@ -11,21 +11,15 @@ import { Provider } from 'react-redux' import thunk from 'redux-thunk' import createLogger from 'redux-logger' -// Auth0 -import { Auth0Provider } from 'use-auth0-hooks' -import { accountLinks, getAuth0Callbacks, getAuth0Config } from './lib/util/auth' -import { AUTH0_AUDIENCE, AUTH0_SCOPE, URL_ROOT } from './lib/util/constants' - // import Bootstrap Grid components for layout -import { Nav, Navbar, Grid, Row, Col } from 'react-bootstrap' +import { Grid, Row, Col } from 'react-bootstrap' // import OTP-RR components import { - AppMenu, + AppNav, DefaultMainPanel, Map, MobileMain, - NavLoginButtonAuth0, ResponsiveWebapp, createOtpReducer, createUserReducer @@ -81,37 +75,13 @@ const store = createStore( compose(applyMiddleware(...middleware)) ) -// Auth0 config and callbacks. -const auth0Config = getAuth0Config(otpConfig.persistence) -const auth0Callbacks = getAuth0Callbacks(store) - // define a simple responsive UI using Bootstrap and OTP-RR class OtpRRExample extends Component { render () { /** desktop view **/ const desktopView = (
+ In order to access this page you will need to sign in. + Please wait while we redirect you to the login page... +
+- In order to access this page you will need to sign in. - Please wait while we redirect you to the login page... -
-