diff --git a/src/App.tsx b/src/App.tsx index fc0ab76..98a591b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -34,19 +34,13 @@ function App() { {/* Landing page - só mostra se não estiver logado */} - Carregando...}> - - - - ) : } + element={isLoggedIn ? : } /> - {/* Auth route */} + {/* Auth route - redireciona para dashboard se já estiver logado */} : } + element={isLoggedIn ? : } /> {/* Email confirmation route */} diff --git a/src/components/auth/LoginForm.tsx b/src/components/auth/LoginForm.tsx index 27fee19..a2b671c 100644 --- a/src/components/auth/LoginForm.tsx +++ b/src/components/auth/LoginForm.tsx @@ -36,7 +36,8 @@ const LoginForm = ({ isLoading, setIsLoading }: LoginFormProps) => { toast.success("Login realizado com sucesso", { description: "Bem-vindo de volta!" }); - navigate('/'); + // Redirecionar para o dashboard após login bem-sucedido + navigate('/dashboard'); } }; diff --git a/src/pages/Auth.tsx b/src/pages/Auth.tsx index 3fa7593..63876fe 100644 --- a/src/pages/Auth.tsx +++ b/src/pages/Auth.tsx @@ -4,6 +4,8 @@ import { Link, useLocation } from 'react-router-dom'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Boxes } from "@/components/ui/background-boxes"; +import { Button } from "@/components/ui/button"; +import { ArrowLeft } from "lucide-react"; import { cn } from "@/lib/utils"; import LoginForm from '@/components/auth/LoginForm'; import RegisterForm from '@/components/auth/RegisterForm'; @@ -36,6 +38,14 @@ const Auth = () => { + {/* Botão para voltar à landing page */} + + + +