'use client' import { useState } from 'react' import { useAuth } from '@/lib/auth/context' export default function ApertureLogin() { const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState('') const { signInWithPassword } = useAuth() const handleLogin = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError('') try { const { error } = await signInWithPassword(email, password) if (error) { setError(error.message) setLoading(false) } else { // AuthProvider and AuthGuard will handle redirect automatically setLoading(false) } } catch (err) { console.error('Login error:', err) setError('An error occurred') setLoading(false) } } return (
Staff, Manager, or Admin access