diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index 0398b59..45452f9 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -1,10 +1,17 @@ -import { useState } from 'react' -import { Link, useLocation } from 'react-router-dom' +import { useState, useEffect } from 'react' +import { Link, useLocation, useNavigate } from 'react-router-dom' import { useAuth } from '../context/AuthContext' export function LoginPage() { const { login } = useAuth() const location = useLocation() + const navigate = useNavigate() + + // Auf Mobilgeräten / Tablets → mobile Login-Seite + useEffect(() => { + const isMobile = window.innerWidth < 1024 || /Mobi|Android|Tablet|iPad|iPhone/i.test(navigator.userAgent) + if (isMobile) navigate('/mobile/login', { replace: true }) + }, []) const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('')