Compare commits

...

3 Commits

Author SHA1 Message Date
aaa6e7def4 Version bump to test sso
All checks were successful
Build containers when image tags change / build-if-image-changed (backend, shorefront-backend, shorefront backend, backend/Dockerfile, git.baumann.gr/adebaumann/shorefront-backend, .backend.image) (push) Successful in 1m18s
Build containers when image tags change / build-if-image-changed (frontend, shorefront-frontend, shorefront frontend, frontend/Dockerfile, git.baumann.gr/adebaumann/shorefront-frontend, .frontend.image) (push) Successful in 1m36s
2026-03-01 01:02:44 +01:00
2b6cd29413 feat(sso): bump container version for SSO release 2026-03-01 00:55:19 +01:00
daabafc595 feat(sso): replace login form with SSO redirect button 2026-03-01 00:55:07 +01:00
2 changed files with 8 additions and 26 deletions

View File

@@ -1,41 +1,23 @@
import { useState, FormEvent } from 'react'
import Box from '@mui/material/Box' import Box from '@mui/material/Box'
import Card from '@mui/material/Card' import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent' import CardContent from '@mui/material/CardContent'
import TextField from '@mui/material/TextField'
import Button from '@mui/material/Button' import Button from '@mui/material/Button'
import Typography from '@mui/material/Typography' import Typography from '@mui/material/Typography'
import Alert from '@mui/material/Alert'
import { authApi } from '../api'
export default function Login() { export default function Login() {
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const [error, setError] = useState('')
const handleSubmit = async (e: FormEvent) => {
e.preventDefault()
setError('')
try {
await authApi.login(username, password)
window.location.href = '/configs'
} catch {
setError('Invalid username or password')
}
}
return ( return (
<Box sx={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', bgcolor: '#f5f7fa' }}> <Box sx={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', bgcolor: '#f5f7fa' }}>
<Card sx={{ width: 380, boxShadow: 3 }}> <Card sx={{ width: 380, boxShadow: 3 }}>
<CardContent sx={{ p: 4 }}> <CardContent sx={{ p: 4 }}>
<Typography variant="h5" fontWeight={700} gutterBottom>Shorefront</Typography> <Typography variant="h5" fontWeight={700} gutterBottom>Shorefront</Typography>
<Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>Sign in to manage your Shorewall configs</Typography> <Typography variant="body2" color="text.secondary" sx={{ mb: 3 }}>Sign in to manage your Shorewall configs</Typography>
{error && <Alert severity="error" sx={{ mb: 2 }}>{error}</Alert>} <Button
<Box component="form" onSubmit={handleSubmit}> variant="contained"
<TextField fullWidth label="Username" value={username} onChange={(e) => setUsername(e.target.value)} sx={{ mb: 2 }} size="small" required /> fullWidth
<TextField fullWidth label="Password" type="password" value={password} onChange={(e) => setPassword(e.target.value)} sx={{ mb: 3 }} size="small" required /> onClick={() => { window.location.href = '/api/auth/oidc/login' }}
<Button type="submit" variant="contained" fullWidth>Sign In</Button> >
</Box> Sign in with SSO
</Button>
</CardContent> </CardContent>
</Card> </Card>
</Box> </Box>

View File

@@ -42,4 +42,4 @@ keycloak:
redirectUri: https://shorefront.baumann.gr/api/auth/oidc/callback redirectUri: https://shorefront.baumann.gr/api/auth/oidc/callback
containers: containers:
version: "0.002" version: "0.004"