From 37247e319c098bed3d71b76632ebf56f5e3bf589 Mon Sep 17 00:00:00 2001 From: Felipe Coutinho Date: Thu, 28 May 2026 10:58:43 -0300 Subject: [PATCH] feat(auth): adiciona sessao persistente no login --- src/features/auth/components/login-form.tsx | 22 ++++++++++++++++++++- src/shared/lib/auth/config.ts | 21 ++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/features/auth/components/login-form.tsx b/src/features/auth/components/login-form.tsx index 1f84fe6..18c8d5a 100644 --- a/src/features/auth/components/login-form.tsx +++ b/src/features/auth/components/login-form.tsx @@ -4,6 +4,7 @@ import { useRouter } from "next/navigation"; import { type FormEvent, useEffect, useState } from "react"; import { toast } from "sonner"; import { Button } from "@/shared/components/ui/button"; +import { Checkbox } from "@/shared/components/ui/checkbox"; import { Field, FieldDescription, @@ -38,6 +39,7 @@ export function LoginForm({ const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [rememberMe, setRememberMe] = useState(false); const [error, setError] = useState(""); const [loadingEmail, setLoadingEmail] = useState(false); @@ -60,7 +62,7 @@ export function LoginForm({ email, password, callbackURL: "/dashboard", - rememberMe: false, + rememberMe, }, { onRequest: () => { @@ -186,6 +188,24 @@ export function LoginForm({ /> +
+ setRememberMe(checked === true)} + disabled={loadingEmail || loadingGoogle || loadingPasskey} + className="mt-0.5" + /> +
+ + Manter conectado neste dispositivo + +
+
+