File tree Expand file tree Collapse file tree 3 files changed +7
-52
lines changed
templates/auth/better-auth/web/react/next/src/app/dashboard Expand file tree Collapse file tree 3 files changed +7
-52
lines changed Original file line number Diff line number Diff line change @@ -64,15 +64,12 @@ export async function setupDatabase(
6464 } ) ;
6565 }
6666
67- // workaround
68- if ( backend === "self" ) {
69- const webDir = path . join ( projectDir , "apps/web" ) ;
70- if ( await fs . pathExists ( webDir ) ) {
71- await addPackageDependency ( {
72- dependencies : [ "@prisma/client" ] ,
73- projectDir : webDir ,
74- } ) ;
75- }
67+ const webDir = path . join ( projectDir , "apps/web" ) ;
68+ if ( await fs . pathExists ( webDir ) ) {
69+ await addPackageDependency ( {
70+ dependencies : [ "@prisma/client" ] ,
71+ projectDir : webDir ,
72+ } ) ;
7673 }
7774 } else if ( orm === "drizzle" ) {
7875 if ( database === "sqlite" ) {
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ async function setupWithCreateDb(
4040 orm : ORM ,
4141) {
4242 try {
43- log . info (
44- "Starting Prisma Postgres setup with create-db. Please follow the instructions below:" ,
45- ) ;
43+ log . info ( "Starting Prisma Postgres setup with create-db." ) ;
4644
4745 const selectedRegion = await select ( {
4846 message : "Select your preferred region:" ,
Original file line number Diff line number Diff line change 1- {{ #if (eq backend " self" )}}
21import { redirect } from "next/navigation";
32import Dashboard from "./dashboard";
43import { headers } from "next/headers";
@@ -27,42 +26,3 @@ export default async function DashboardPage() {
2726 </div >
2827 );
2928}
30- {{ else }}
31- import { authClient } from "@/lib/auth-client";
32- import { redirect } from "next/navigation";
33- import Dashboard from "./dashboard";
34- import { headers } from "next/headers";
35-
36- export default async function DashboardPage() {
37- const session = await authClient.getSession({
38- fetchOptions: {
39- headers: await headers()
40- }
41- });
42-
43- if (!session.data) {
44- redirect("/login");
45- }
46-
47- {{ #if (eq payments " polar" )}}
48- const { data: customerState, error } = await authClient.customer.state({
49- fetchOptions: {
50- headers: await headers()
51- }
52- });
53- {{ /if }}
54-
55- return (
56- <div >
57- <h1 >Dashboard</h1 >
58- <p >Welcome {session.data.user.name}</p >
59- <Dashboard
60- session = {session.data}
61- {{ #if (eq payments " polar" )}}
62- customerState = {customerState}
63- {{ /if }}
64- />
65- </div >
66- );
67- }
68- {{ /if }}
You can’t perform that action at this time.
0 commit comments