commit wip

This commit is contained in:
2025-10-22 15:54:42 -06:00
parent d491100c73
commit 3fccdc0478
6 changed files with 46 additions and 9 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
import { createFileRoute, redirect } from "@tanstack/react-router"
import { createFileRoute, redirect, useRouter } from "@tanstack/react-router"
import { useState } from "react"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
@@ -27,6 +27,7 @@ function LoginComponent() {
const [isLoading, setIsLoading] = useState(false)
const [error, setError] = useState("")
const [showPassword, setShowPassword] = useState(false)
const router = useRouter()
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
@@ -35,7 +36,7 @@ function LoginComponent() {
try {
await auth.login(email, password)
window.location.href = redirect
router.navigate({ to: redirect})
} catch (err: any) {
setError(err.message || "No fue posible iniciar sesión")
} finally {