local authentication placeholder

This commit is contained in:
Carter 2026-04-29 10:20:44 -06:00
parent 8169e280ec
commit 3b62d87d31
6 changed files with 105 additions and 17 deletions

View file

@ -0,0 +1,61 @@
import { Box, Button, CssBaseline, Paper, Stack, Typography } from '@mui/material'
import { getName } from 'services/whiteLabel'
export type LocalAuthPlaceholderReason = 'unconfigured' | 'insecure_origin'
interface Props {
/** Why cloud Auth0 was skipped — copy differs when env is set but the page is not a secure context (e.g. http://LAN IP). */
reason?: LocalAuthPlaceholderReason
}
/**
* Shown when Auth0 is not used (missing config and/or nonsecure context).
* Replace with backend-driven login once local auth is implemented.
*/
export default function LocalAuthPlaceholder(props: Props) {
const { reason = 'unconfigured' } = props
const productName = getName()
const explanation =
reason === 'insecure_origin'
? 'This URL is not a secure context for cloud sign-in (Auth0 requires HTTPS, localhost, or 127.0.0.1). Use local account sign-in here instead once it is connected.'
: 'Cloud sign-in (Auth0) is not configured for this deployment. Local account sign-in will be available here.'
return (
<>
<CssBaseline />
<Box
sx={{
minHeight: '100vh',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
bgcolor: 'background.default',
p: 2,
}}
>
<Paper elevation={2} sx={{ maxWidth: 420, width: '100%', p: 4 }}>
<Stack spacing={3} alignItems="stretch">
<Typography variant="h5" component="h1">
{productName}
</Typography>
<Typography variant="body2" color="text.secondary">
{explanation}
</Typography>
<Stack spacing={1.5}>
<Button variant="contained" size="large" disabled>
Log in
</Button>
<Button variant="outlined" size="large" disabled>
Sign up
</Button>
</Stack>
<Typography variant="caption" color="text.secondary">
Buttons are placeholders until the backend login flow is wired up.
</Typography>
</Stack>
</Paper>
</Box>
</>
)
}