diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 45e94bc..7ef016a 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -2,14 +2,20 @@ import { signIn } from "next-auth/react"; import { useState } from "react"; +import { useRouter } from "next/navigation"; export default function LoginPage() { + const router = useRouter(); const [status, setStatus] = useState<"idle" | "loading">("idle"); - // Quick demo login - in production use magic link - const handleDemoLogin = async () => { + const handleLogin = async () => { setStatus("loading"); - await signIn("email", { email: "manohar6839@gmail.com", redirect: true, callbackUrl: "/" }); + // Demo: auto-login with test user + await signIn("email", { + email: "manohar6839@gmail.com", + redirect: false + }); + router.push("/"); }; return ( @@ -19,16 +25,12 @@ export default function LoginPage() {
Your baby tracking companion
- -- (Demo mode - no email needed) -
); diff --git a/src/auth.ts b/src/auth.ts index da3585c..ad59df5 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,29 +1,10 @@ import NextAuth from "next-auth"; import { DrizzleAdapter } from "@auth/drizzle-adapter"; -import { Resend } from "resend"; import { db } from "@/db"; -import { users } from "@/db/schema/auth"; -import { eq } from "drizzle-orm"; - -const resend = new Resend(process.env.RESEND_API_KEY); export const { handlers, auth, signIn, signOut } = NextAuth({ adapter: DrizzleAdapter(db), - providers: [ - { - id: "resend", - type: "email", - name: "Email", - sendVerificationRequest: async ({ identifier, url }) => { - await resend.emails.send({ - from: "TiaClick here to sign in to Tia.
`, - }); - }, - }, - ], + providers: [], pages: { signIn: "/login", },