'use client'; import { useState } from 'react'; import { signIn } from 'next-auth/react'; import { useRouter } from 'next/navigation'; import { ShieldAlert, Lock, Mail, ArrowRight, Loader2 } from 'lucide-react'; import { YoutubeIcon as Youtube } from '@/components/icons/YoutubeIcon'; export default function LoginPage() { const router = useRouter(); const [email, setEmail] = useState('admin@ayris.tech'); const [password, setPassword] = useState('admin'); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); const result = await signIn('credentials', { redirect: false, email, password, }); if (result?.error) { setError('Invalid email or password'); setLoading(false); } else { router.push('/admin'); router.refresh(); } }; return (
{/* Header */}
ayris.tech Logo

Creator Admin Login

Sign in to manage YouTube lessons, code snippets, and viewer messages.

{error && (
{error}
)}
setEmail(e.target.value)} required className="w-full bg-slate-950 border border-slate-800 rounded-xl pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-red-500" placeholder="admin@ayris.tech" />
setPassword(e.target.value)} required className="w-full bg-slate-950 border border-slate-800 rounded-xl pl-10 pr-4 py-2.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-red-500" placeholder="••••••••" />
Demo Admin Credentials:
Email: admin@ayris.tech
Password: admin
); }