import React, { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { motion, AnimatePresence } from 'framer-motion'; import { Shield, ArrowRight, Loader2, Key, ChevronRight, Lock } from 'lucide-react'; import api from '../lib/api'; import { useAuth } from '../context/AuthContext'; import { DevTools } from '../components/dev/DevTools'; import { pageVariants, itemVariants } from '../lib/animations'; export default function LoginPage() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const { login } = useAuth(); const navigate = useNavigate(); useEffect(() => { document.title = 'Veridian | Authentication'; }, []); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setIsLoading(true); try { const { data } = await api.post('/auth/login', { email, password }); login(data.accessToken, data.refreshToken, data.user); navigate('/dashboard'); } catch (err: any) { setError(err.response?.data?.message || 'Authentication failed. Please check your credentials.'); } finally { setIsLoading(false); } }; return (
Operations Infrastructure
Operations Center
{error}
Global Security
This system is for the exclusive use of authorized personnel. All activity is logged and monitored for compliance integrity.