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
|
|
@ -43,10 +43,6 @@ if [[ ! -f "$INDEX_HTML" ]]; then
|
|||
echo "error: missing $INDEX_HTML after build:local" >&2
|
||||
exit 1
|
||||
fi
|
||||
if grep -qiE 'crisp\.chat|\$crisp|CRISP_WEBSITE_ID|CRISP_RUNTIME_CONFIG' "$INDEX_HTML"; then
|
||||
echo "error: build/index.html still references Crisp; expected nocrisp build (indexLocal.html)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Build container image
|
||||
docker build -t webui:local -f Dockerfile .
|
||||
|
|
|
|||
|
|
@ -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