diff --git a/README.md b/README.md index 75a6906..714a0f4 100644 --- a/README.md +++ b/README.md @@ -134,9 +134,6 @@ This project is configured with a professional CI/CD pipeline to ensure code qua - **Continuous Deployment (CD)**: Handled by Vercel. Every successful push to the main branch is automatically built and deployed to the live environment with zero downtime. -## Test Credentials -- Email-test12@gmail.com -- Password= test12@2003 ## Maintainer Contact - Email - beesoul98012@gmail.com diff --git a/src/components/auth/LoginForm.tsx b/src/components/auth/LoginForm.tsx index fd060d7..1a067a9 100644 --- a/src/components/auth/LoginForm.tsx +++ b/src/components/auth/LoginForm.tsx @@ -6,7 +6,7 @@ import { useForm } from "react-hook-form" import { zodResolver } from "@hookform/resolvers/zod" import { signIn } from "next-auth/react" import { useRouter } from "next/navigation" -import { Loader2 } from "lucide-react" +import { Loader2, Copy, Check } from "lucide-react" import { Button } from "@/components/ui/button" import { Form, @@ -48,6 +48,42 @@ export default function LoginForm({ defaultCredentials }: LoginFormProps) { }, }) + // Test credentials for quick access in the login modal + const testEmail = "test12@gmail.com" + const testPassword = "test12@2003" + const [copiedEmail, setCopiedEmail] = useState(false) + const [copiedPassword, setCopiedPassword] = useState(false) + + const copyToClipboard = async (text: string, type: 'email' | 'password') => { + try { + await navigator.clipboard.writeText(text) + if (type === 'email') { + setCopiedEmail(true) + setTimeout(() => setCopiedEmail(false), 2000) + } else { + setCopiedPassword(true) + setTimeout(() => setCopiedPassword(false), 2000) + } + + toast({ + title: 'Copied!', + description: `${type === 'email' ? 'Email' : 'Password'} copied to clipboard`, + }) + } catch { + toast({ + variant: 'destructive', + title: 'Failed to copy', + description: 'Please copy manually', + }) + } + } + + const handleAutoFillLocal = () => { + form.setValue('email', testEmail) + form.setValue('password', testPassword) + toast({ title: 'Credentials filled', description: 'Test credentials have been auto-filled' }) + } + // Auto-fill credentials when provided from test credentials popup useEffect(() => { if (defaultCredentials) { @@ -168,6 +204,58 @@ export default function LoginForm({ defaultCredentials }: LoginFormProps) { "Login" )} + + {/* Inline test credentials for quick access */} +