fix: viewport metadata (Next.js 15), lazy auth client init (location SSR error), force-dynamic dashboard

This commit is contained in:
Renato
2026-07-20 18:14:06 +02:00
parent e69b18abaa
commit b15e72837f
7 changed files with 52 additions and 21 deletions
+9 -2
View File
@@ -2,7 +2,7 @@
import { useState } from "react"
import { useRouter } from "next/navigation"
import { authClient } from "@/lib/auth-client"
import { getAuth } from "@/lib/auth-client"
export default function LoginPage() {
const [email, setEmail] = useState("")
@@ -16,7 +16,14 @@ export default function LoginPage() {
setLoading(true)
setError("")
const { error: err } = await authClient.signIn.email({
const auth = getAuth()
if (!auth) {
setError("Error de inicialización")
setLoading(false)
return
}
const { error: err } = await auth.signIn.email({
email,
password,
})
+3 -2
View File
@@ -1,7 +1,7 @@
"use client"
import { useState } from "react"
import { authClient } from "@/lib/auth-client"
import { getAuth } from "@/lib/auth-client"
import { useRouter } from "next/navigation"
import { GatoMascota } from "@/components/child/gato-mascota"
@@ -10,7 +10,8 @@ export default function PairingPage() {
const [loading, setLoading] = useState(false)
const [error, setError] = useState("")
const [paired, setPaired] = useState(false)
const { data: session } = authClient.useSession()
const auth = getAuth()
const { data: session } = auth?.useSession() ?? { data: null }
const router = useRouter()
const handlePairing = async (e: React.FormEvent) => {