Route tenant admin PWA via /event-admin

This commit is contained in:
Codex Agent
2025-10-10 15:20:52 +02:00
parent 417b1da484
commit 52197f216d
20 changed files with 112 additions and 75 deletions

View File

@@ -3,6 +3,7 @@ import { Location, useLocation, useNavigate } from 'react-router-dom';
import { Button } from '@/components/ui/button';
import AppearanceToggleDropdown from '@/components/appearance-dropdown';
import { useAuth } from '../auth/context';
import { ADMIN_HOME_PATH } from '../constants';
interface LocationState {
from?: Location;
@@ -17,7 +18,7 @@ export default function LoginPage() {
React.useEffect(() => {
if (status === 'authenticated') {
navigate('/admin', { replace: true });
navigate(ADMIN_HOME_PATH, { replace: true });
}
}, [status, navigate]);
@@ -29,7 +30,7 @@ export default function LoginPage() {
const hash = from.hash ?? '';
return `${from.pathname}${search}${hash}`;
}
return '/admin';
return ADMIN_HOME_PATH;
}, [location.state]);
return (
@@ -41,7 +42,7 @@ export default function LoginPage() {
<div className="space-y-4 text-sm text-muted-foreground">
<p>
Melde dich mit deinem Fotospiel-Account an. Du wirst zur sicheren OAuth-Anmeldung weitergeleitet und danach
wieder zur Admin-Oberfl<EFBFBD>che gebracht.
wieder zur Admin-Oberflaeche gebracht.
</p>
{oauthError && (
<div className="rounded border border-red-300 bg-red-50 p-2 text-sm text-red-700">
@@ -53,9 +54,10 @@ export default function LoginPage() {
disabled={status === 'loading'}
onClick={() => login(redirectTarget)}
>
{status === 'loading' ? 'Bitte warten <EFBFBD>' : 'Mit Tenant-Account anmelden'}
{status === 'loading' ? 'Bitte warten ...' : 'Mit Tenant-Account anmelden'}
</Button>
</div>
</div>
);
}