fix(login/onboarding): redirect to dashboard if already logged in

This commit is contained in:
Nicolas Meienberger
2025-10-25 22:42:51 +02:00
parent a7bc1c2e7e
commit 37a22b260f
4 changed files with 20 additions and 6 deletions

View File

@@ -9,6 +9,9 @@ import { AuthLayout } from "~/components/auth-layout";
import { Button } from "~/components/ui/button";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "~/components/ui/form";
import { Input } from "~/components/ui/input";
import { authMiddleware } from "~/middleware/auth";
export const clientMiddleware = [authMiddleware];
const loginSchema = type({
username: "2<=string<=50",
@@ -35,7 +38,7 @@ export default function LoginPage() {
},
onError: (error) => {
console.error(error);
toast.error("Login failed");
toast.error("Login failed", { description: error.message });
},
});