feat: add user role management (admin/partner/gesperrt) with login block
All checks were successful
Staging Build / build (push) Successful in 2m44s

This commit is contained in:
DanielS
2026-06-24 14:26:25 +02:00
parent 26de6820e3
commit cd04309e3e
5 changed files with 103 additions and 33 deletions

View File

@@ -25,10 +25,13 @@ export function LoginForm({
const [error, setError] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(false);
const [messageParam, setMessageParam] = useState<string | null>(null);
const [errorParam, setErrorParam] = useState<string | null>(null);
const router = useRouter();
useEffect(() => {
setMessageParam(new URLSearchParams(window.location.search).get('message'));
const params = new URLSearchParams(window.location.search);
setMessageParam(params.get('message'));
setErrorParam(params.get('error'));
}, []);
const handleLogin = async (e: React.FormEvent) => {
@@ -99,6 +102,11 @@ export function LoginForm({
onChange={(e) => setPassword(e.target.value)}
/>
</div>
{errorParam === "gesperrt" && (
<p className="text-sm text-red-500 bg-red-500/10 border border-red-500/20 p-3 rounded-lg text-center font-medium">
🚫 Ihr Konto wurde gesperrt. Bitte wenden Sie sich an den Administrator.
</p>
)}
{messageParam === "concurrent" && (
<p className="text-sm text-amber-500 bg-amber-500/10 border border-amber-500/20 p-3 rounded-lg text-center font-medium">
Sie wurden abgemeldet, da Sie sich an einem anderen Gerät angemeldet haben.