diff --git a/src/app/auth/Login.tsx b/src/app/auth/Login.tsx index 6c1e61d..31e8a2e 100644 --- a/src/app/auth/Login.tsx +++ b/src/app/auth/Login.tsx @@ -7,6 +7,7 @@ import { useRouter } from "next/navigation"; import { CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { loginUser } from "@/actions/user"; import Cookies from "js-cookie"; +import { EyeIcon, EyeOffIcon } from "lucide-react"; type Feedback = { kind: "error" | "info"; message: string }; @@ -14,6 +15,7 @@ export default function Login() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [feedback, setFeedback] = useState(); + const [passwordVisible, setPasswordVisible] = useState(false); const router = useRouter(); @@ -54,14 +56,29 @@ export default function Login() { Password - setPassword(e.target.value)} - onKeyDown={(e) => { - if (e.key === "Enter") login(); - }} - type="password" - /> +
+ setPassword(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") login(); + }} + type={passwordVisible ? "text" : "password"} + /> +
+
setPasswordVisible((prev) => !prev)} + > + {passwordVisible ? ( + + ) : ( + + )} +
+
+
{feedback && ( @@ -76,7 +93,7 @@ export default function Login() { )} -