front end flow for bypassing auth0 on local buils
This commit is contained in:
parent
23de0a3bca
commit
8169e280ec
2 changed files with 12 additions and 4 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import { Auth0Provider } from '@auth0/auth0-react'
|
||||
import { or } from '../utils/types'
|
||||
import { isAuth0Configured, isAuth0SpaOriginAllowed, shouldMountAuth0Provider } from '../utils/auth0Config'
|
||||
import AuthWrapper from '../providers/auth'
|
||||
import HTTPProvider from 'providers/http'
|
||||
import { useState } from 'react'
|
||||
import LoadingScreen from './LoadingScreen'
|
||||
import LocalAuthPlaceholder from './LocalAuthPlaceholder'
|
||||
import UserWrapper from './UserWrapper'
|
||||
import { getWhitelabel } from 'services/whiteLabel'
|
||||
import { AppThemeProvider } from 'theme/AppThemeProvider'
|
||||
|
|
@ -54,6 +56,16 @@ function App() {
|
|||
"/libracart"
|
||||
]
|
||||
|
||||
if (!shouldMountAuth0Provider()) {
|
||||
const placeholderReason =
|
||||
isAuth0Configured() && !isAuth0SpaOriginAllowed() ? 'insecure_origin' : 'unconfigured'
|
||||
return (
|
||||
<AppThemeProvider>
|
||||
<LocalAuthPlaceholder reason={placeholderReason} />
|
||||
</AppThemeProvider>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<AppThemeProvider>
|
||||
<Auth0Provider
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue