Skip to content

Commit 9f099b1

Browse files
fix(cli): use authClient for the polar client
1 parent 53c7e92 commit 9f099b1

File tree

1 file changed

+5
-2
lines changed
  • apps/cli/templates/auth/better-auth/web/react/next/src/app/dashboard

1 file changed

+5
-2
lines changed

apps/cli/templates/auth/better-auth/web/react/next/src/app/dashboard/page.tsx.hbs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { redirect } from "next/navigation";
22
import Dashboard from "./dashboard";
33
import { headers } from "next/headers";
44
import { auth } from "@{{projectName}}/auth";
5+
import { authClient } from "@/lib/auth-client";
56

67
export default async function DashboardPage() {
78
const session = await auth.api.getSession({
@@ -13,8 +14,10 @@ export default async function DashboardPage() {
1314
}
1415

1516
{{#if (eq payments "polar")}}
16-
const { data: customerState } = await auth.api.customer.state({
17-
headers: await headers(),
17+
const { data: customerState } = await authClient.customer.state({
18+
fetchOptions: {
19+
headers: await headers(),
20+
},
1821
});
1922
{{/if}}
2023

0 commit comments

Comments
 (0)