({
setPage,
}: {
setPage: (page: "home" | "sign-in" | "sign-up") => void;
})
| 19 | const { signIn } = authClient; |
| 20 | |
| 21 | export function SignIn({ |
| 22 | setPage, |
| 23 | }: { |
| 24 | setPage: (page: "home" | "sign-in" | "sign-up") => void; |
| 25 | }) { |
| 26 | const [email, setEmail] = useState(""); |
| 27 | const [password, setPassword] = useState(""); |
| 28 | const [loading, setLoading] = useState(false); |
| 29 | const [rememberMe, setRememberMe] = useState(false); |
| 30 | |
| 31 | return ( |
| 32 | <Card className="max-w-md border-0"> |
| 33 | <CardHeader> |
| 34 | <CardTitle className="text-lg md:text-xl">Sign In</CardTitle> |
| 35 | <CardDescription className="text-xs md:text-sm"> |
| 36 | Enter your email below to login to your account |
| 37 | </CardDescription> |
| 38 | </CardHeader> |
| 39 | <CardContent> |
| 40 | <div className="grid gap-4"> |
| 41 | <div className="grid gap-2"> |
| 42 | <Label htmlFor="email">Email</Label> |
| 43 | <Input |
| 44 | id="email" |
| 45 | type="email" |
| 46 | placeholder="m@example.com" |
| 47 | required |
| 48 | onChange={(e) => { |
| 49 | setEmail(e.target.value); |
| 50 | }} |
| 51 | value={email} |
| 52 | /> |
| 53 | </div> |
| 54 | |
| 55 | <div className="grid gap-2"> |
| 56 | <div className="flex items-center"> |
| 57 | <Label htmlFor="password">Password</Label> |
| 58 | <a href="#" className="inline-block ml-auto text-sm underline"> |
| 59 | Forgot your password? |
| 60 | </a> |
| 61 | </div> |
| 62 | |
| 63 | <Input |
| 64 | id="password" |
| 65 | type="password" |
| 66 | placeholder="password" |
| 67 | autoComplete="password" |
| 68 | value={password} |
| 69 | onChange={(e) => setPassword(e.target.value)} |
| 70 | /> |
| 71 | </div> |
| 72 | |
| 73 | <div className="flex items-center gap-2"> |
| 74 | <Checkbox |
| 75 | id="remember" |
| 76 | onClick={() => { |
| 77 | setRememberMe(!rememberMe); |
| 78 | }} |
nothing calls this directly
no outgoing calls
no test coverage detected