Skip to content

Commit 969ebe9

Browse files
fix: bug fixes to better auth ,cli and prisma generated (#2167)
1 parent 3cd1c93 commit 969ebe9

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

.changeset/beige-clouds-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-t3-app": patch
3+
---
4+
5+
fix #1903 #2157 #2163

cli/src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const runCli = async (): Promise<CliResults> => {
144144
)
145145
/** @experimental - Used for CI E2E tests. Used in conjunction with `--CI` to skip prompting. */
146146
.option(
147-
"-i, --import-alias",
147+
"-i, --import-alias [alias]",
148148
"Explicitly tell the CLI to use a custom import alias",
149149
defaultOptions.flags.importAlias
150150
)

cli/template/base/_gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/prisma/db.sqlite
1313
/prisma/db.sqlite-journal
1414
db.sqlite
15+
/generated/
1516

1617
# next.js
1718
/.next/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { betterAuth } from "better-auth";
2+
import { nextCookies } from "better-auth/next-js";
23

34
export const auth = betterAuth({
45
emailAndPassword: {
56
enabled: true,
67
},
8+
// Make sure nextCookies() is the last plugin in the array
9+
plugins: [nextCookies()],
710
});
811

912
export type Session = typeof auth.$Infer.Session;

cli/template/extras/src/server/better-auth/config/with-drizzle.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { betterAuth } from "better-auth";
22
import { drizzleAdapter } from "better-auth/adapters/drizzle";
3+
import { nextCookies } from "better-auth/next-js";
34

45
import { env } from "~/env";
56
import { db } from "~/server/db";
@@ -18,6 +19,8 @@ export const auth = betterAuth({
1819
redirectURI: "http://localhost:3000/api/auth/callback/github",
1920
},
2021
},
22+
// Make sure nextCookies() is the last plugin in the array
23+
plugins: [nextCookies()],
2124
});
2225

2326
export type Session = typeof auth.$Infer.Session;

cli/template/extras/src/server/better-auth/config/with-prisma.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { betterAuth } from "better-auth";
22
import { prismaAdapter } from "better-auth/adapters/prisma";
3+
import { nextCookies } from "better-auth/next-js";
34

45
import { env } from "~/env";
56
import { db } from "~/server/db";
@@ -18,6 +19,8 @@ export const auth = betterAuth({
1819
redirectURI: "http://localhost:3000/api/auth/callback/github",
1920
},
2021
},
22+
// Make sure nextCookies() is the last plugin in the array
23+
plugins: [nextCookies()],
2124
});
2225

2326
export type Session = typeof auth.$Infer.Session;

0 commit comments

Comments
 (0)