@@ -6,9 +6,9 @@ import { signInWithEmailAndPassword } from "firebase/auth";
6
6
import { auth } from "@/firebase/config" ;
7
7
import { useRouter } from "next/navigation" ;
8
8
import Link from "next/link" ;
9
- import { FaEnvelope , FaLock } from "react-icons/fa" ;
9
+ import { FaEnvelope , FaLock , FaArrowLeft } from "react-icons/fa" ;
10
10
11
- export default function LoginPage ( ) {
11
+ export default function Login ( ) {
12
12
const [ email , setEmail ] = useState ( "" ) ;
13
13
const [ password , setPassword ] = useState ( "" ) ;
14
14
const [ error , setError ] = useState ( "" ) ;
@@ -25,15 +25,24 @@ export default function LoginPage() {
25
25
router . push ( "/dashboard" ) ;
26
26
} catch ( err ) {
27
27
console . error ( "Login error:" , err ) ;
28
- setError ( err . message || "Failed to sign in. Please check your credentials." ) ;
28
+ setError ( "Failed to log in. Please check your credentials." ) ;
29
+ } finally {
30
+ setLoading ( false ) ;
29
31
}
30
-
31
- setLoading ( false ) ;
32
32
} ;
33
33
34
34
return (
35
35
< div className = "min-h-screen flex items-center justify-center bg-gray-900 py-12 px-4 sm:px-6 lg:px-8" >
36
36
< div className = "max-w-md w-full space-y-8" >
37
+ { /* Back Button */ }
38
+ < Link
39
+ href = "/"
40
+ className = "inline-flex items-center text-gray-400 hover:text-white transition-colors"
41
+ >
42
+ < FaArrowLeft className = "w-4 h-4 mr-2" />
43
+ < span > Back to Home</ span >
44
+ </ Link >
45
+
37
46
< div >
38
47
< h2 className = "mt-6 text-center text-3xl font-extrabold text-white" >
39
48
Sign in to your account
0 commit comments