fix: CORS for localhost:3000, login with username or email, favicon

Made-with: Cursor
This commit is contained in:
Talal Sharabi
2026-03-12 15:35:36 +04:00
parent 4c139429e2
commit 854a42980d
6 changed files with 27 additions and 12 deletions

BIN
frontend/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -21,6 +21,9 @@ const readexPro = Readex_Pro({
export const metadata: Metadata = {
title: 'ATMATA - نظام إدارة علاقات العملاء',
description: 'Enterprise CRM System for Contact Management, Sales, HR, Inventory, Projects, and Marketing',
icons: {
icon: '/favicon.ico',
},
}
export default function RootLayout({

View File

@@ -7,7 +7,7 @@ import { LogIn, Mail, Lock, Building2, AlertCircle } from 'lucide-react'
export default function LoginPage() {
const { login } = useAuth()
const [email, setEmail] = useState('')
const [emailOrUsername, setEmailOrUsername] = useState('')
const [password, setPassword] = useState('')
const [error, setError] = useState('')
const [isLoading, setIsLoading] = useState(false)
@@ -18,7 +18,7 @@ export default function LoginPage() {
setIsLoading(true)
try {
await login(email, password)
await login(emailOrUsername, password)
} catch (err: any) {
setError(err.message || 'فشل تسجيل الدخول. الرجاء المحاولة مرة أخرى.')
} finally {
@@ -50,20 +50,21 @@ export default function LoginPage() {
)}
<form onSubmit={handleSubmit} className="space-y-6">
{/* Email Field */}
{/* Email or Username Field */}
<div>
<label htmlFor="email" className="block text-sm font-semibold text-gray-700 mb-2">
البريد الإلكتروني
<label htmlFor="emailOrUsername" className="block text-sm font-semibold text-gray-700 mb-2">
البريد الإلكتروني أو اسم المستخدم
</label>
<div className="relative">
<Mail className="absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400" />
<input
id="email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
id="emailOrUsername"
type="text"
value={emailOrUsername}
onChange={(e) => setEmailOrUsername(e.target.value)}
required
placeholder="example@atmata.com"
placeholder="admin أو example@atmata.com"
autoComplete="username"
className="w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all"
disabled={isLoading}
/>