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
+14 -4
View File
@@ -2,8 +2,18 @@
import { createAuthClient } from "better-auth/react"
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000",
})
let client: ReturnType<typeof createAuthClient> | null = null
export const { signIn, signUp, useSession } = authClient
function initClient() {
if (typeof window === "undefined") return
if (!client) {
client = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000",
})
}
return client
}
export function getAuth() {
return initClient()
}