Skip to content

Commit

Permalink
feat: add autocomplete attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
thraizz committed May 21, 2024
1 parent afe6cd4 commit afdf910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/authentication/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import clsx from "clsx";
import { signInWithEmailAndPassword } from "firebase/auth";
import { useContext } from "react";
import { useForm } from "react-hook-form";
import { useNavigate } from "react-router";
import { auth } from "../../firebase";
import { UserContext } from "../../provider/UserContext";
import { useNavigate } from "react-router";

export const LoginForm = () => {
const { setUser } = useContext(UserContext);
Expand Down Expand Up @@ -49,6 +49,7 @@ export const LoginForm = () => {
Email
</label>
<input
autoComplete="email"
className={clsx(
"rounded-md border-2 border-gray-300 px-4 py-2",
loginForm.formState.errors.email && "has-error",
Expand All @@ -71,6 +72,7 @@ export const LoginForm = () => {
Password
</label>
<input
autoComplete="current-password"
className={clsx(
"rounded-md border-2 border-gray-300 px-4 py-2",
loginForm.formState.errors.password && "border-red-500",
Expand Down
4 changes: 3 additions & 1 deletion src/components/authentication/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import clsx from "clsx";
import { createUserWithEmailAndPassword } from "firebase/auth";
import { useContext } from "react";
import { useForm } from "react-hook-form";
import { useNavigate } from "react-router";
import { auth } from "../../firebase";
import { UserContext } from "../../provider/UserContext";
import { useNavigate } from "react-router";

export const RegisterForm = () => {
const { setUser } = useContext(UserContext);
Expand Down Expand Up @@ -48,6 +48,7 @@ export const RegisterForm = () => {
Email
</label>
<input
autoComplete="email"
className="rounded-md border-2 border-gray-300 px-4 py-2"
type="email"
id="email"
Expand All @@ -61,6 +62,7 @@ export const RegisterForm = () => {
Password
</label>
<input
autoComplete="new-password"
className="rounded-md border-2 border-gray-300 px-4 py-2"
type="password"
id="password"
Expand Down

0 comments on commit afdf910

Please sign in to comment.