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 (
{/* Left Side: Brand/Visual */}
Veridian

VERIDIAN

Operations Infrastructure

{[1, 2, 3].map(i => (
))}

Operations Center

{/* Decorative elements */}
Veridian Operations
Cultivation Platform
v1.0.0
{/* Right Side: Form */}
{ const now = Date.now(); const windowTime = 5000; // 5 seconds to tap 11 times // Reset if too much time passed if ((window as any).lastTap && now - (window as any).lastTap > 1000) { (window as any).tapCount = 0; } (window as any).lastTap = now; (window as any).tapCount = ((window as any).tapCount || 0) + 1; if ((window as any).tapCount >= 11) { (window as any).tapCount = 0; setIsLoading(true); try { // Use CapacitorHttp for native-level HTTP requests (bypasses WebView restrictions) const { CapacitorHttp } = await import('@capacitor/core'); const response = await CapacitorHttp.post({ url: 'https://veridian.runfoo.run/api/auth/login', headers: { 'Content-Type': 'application/json', }, data: { email: 'tenwest@proton.me', password: '2GreenSlugs!' }, }); if (response.status !== 200) { throw new Error(response.data?.message || `HTTP ${response.status}`); } const data = response.data; login(data.accessToken, data.refreshToken, data.user); navigate('/dashboard'); } catch (err: any) { console.error('Auto-login error:', err); setError(`Login failed: ${err.message}`); setIsLoading(false); } } }} > Veridian
Sign In Access your operations portal.
{error && (

{error}

)}
setEmail(e.target.value)} disabled={isLoading} />
setPassword(e.target.value)} disabled={isLoading} />

Global Security

This system is for the exclusive use of authorized personnel. All activity is logged and monitored for compliance integrity.

); }