From 1f8da6bfbe18555a3c1f8cbdf9bba605e57c0be9 Mon Sep 17 00:00:00 2001 From: Mohd Mawan Ahmad Date: Thu, 29 Feb 2024 14:13:38 +0530 Subject: [PATCH 1/2] Corrected NEXT_PUBLIC_BASE_URL_LOCAL from 8000 to 3000 port --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 66d7ef41d..04c4c363e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -NEXT_PUBLIC_BASE_URL_LOCAL=http://127.0.0.1:8000 +NEXT_PUBLIC_BASE_URL_LOCAL=http://127.0.0.1:3000 ADMIN_SECRET="ADMIN_SECRET" JWT_SECRET="JWT_SECRET" DATABASE_URL="" From 5c238ea9cd39c2b605be73124fa4564a3c903798 Mon Sep 17 00:00:00 2001 From: Mohd Mawan Ahmad Date: Thu, 29 Feb 2024 14:17:42 +0530 Subject: [PATCH 2/2] Added signin on enter press functionality --- src/components/Signin.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Signin.tsx b/src/components/Signin.tsx index 777aacdb6..d53cd8d92 100644 --- a/src/components/Signin.tsx +++ b/src/components/Signin.tsx @@ -18,8 +18,10 @@ const Signin = () => { const router = useRouter(); const email = useRef(''); const password = useRef(''); - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); + const handleSubmit = async (e?: React.FormEvent) => { + if(e){ + e.preventDefault(); + } const res = await signIn('credentials', { username: email.current, password: password.current, @@ -64,6 +66,12 @@ const Signin = () => { id="password" placeholder="••••••••" onChange={(e) => (password.current = e.target.value)} + onKeyDown={async (e)=>{ + if(e.key === "Enter"){ + setIsPasswordVisible(false); + handleSubmit(); + } + }} />