diff --git a/.changeset/beige-clouds-behave.md b/.changeset/beige-clouds-behave.md new file mode 100644 index 0000000000..217d9ef8b6 --- /dev/null +++ b/.changeset/beige-clouds-behave.md @@ -0,0 +1,5 @@ +--- +"create-t3-app": patch +--- + +fix #1903 #2157 #2163 diff --git a/cli/src/cli/index.ts b/cli/src/cli/index.ts index e63c05f23a..3d55102855 100644 --- a/cli/src/cli/index.ts +++ b/cli/src/cli/index.ts @@ -144,7 +144,7 @@ export const runCli = async (): Promise => { ) /** @experimental - Used for CI E2E tests. Used in conjunction with `--CI` to skip prompting. */ .option( - "-i, --import-alias", + "-i, --import-alias [alias]", "Explicitly tell the CLI to use a custom import alias", defaultOptions.flags.importAlias ) diff --git a/cli/template/base/_gitignore b/cli/template/base/_gitignore index c24a8359cf..ab2955018b 100644 --- a/cli/template/base/_gitignore +++ b/cli/template/base/_gitignore @@ -12,6 +12,7 @@ /prisma/db.sqlite /prisma/db.sqlite-journal db.sqlite +/generated/ # next.js /.next/ diff --git a/cli/template/extras/src/server/better-auth/config/base.ts b/cli/template/extras/src/server/better-auth/config/base.ts index abf50facaa..5896d7b8d6 100644 --- a/cli/template/extras/src/server/better-auth/config/base.ts +++ b/cli/template/extras/src/server/better-auth/config/base.ts @@ -1,9 +1,12 @@ import { betterAuth } from "better-auth"; +import { nextCookies } from "better-auth/next-js"; export const auth = betterAuth({ emailAndPassword: { enabled: true, }, + // Make sure nextCookies() is the last plugin in the array + plugins: [nextCookies()], }); export type Session = typeof auth.$Infer.Session; diff --git a/cli/template/extras/src/server/better-auth/config/with-drizzle.ts b/cli/template/extras/src/server/better-auth/config/with-drizzle.ts index b1784e3af9..b0a86371d1 100644 --- a/cli/template/extras/src/server/better-auth/config/with-drizzle.ts +++ b/cli/template/extras/src/server/better-auth/config/with-drizzle.ts @@ -1,5 +1,6 @@ import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; +import { nextCookies } from "better-auth/next-js"; import { env } from "~/env"; import { db } from "~/server/db"; @@ -18,6 +19,8 @@ export const auth = betterAuth({ redirectURI: "http://localhost:3000/api/auth/callback/github", }, }, + // Make sure nextCookies() is the last plugin in the array + plugins: [nextCookies()], }); export type Session = typeof auth.$Infer.Session; diff --git a/cli/template/extras/src/server/better-auth/config/with-prisma.ts b/cli/template/extras/src/server/better-auth/config/with-prisma.ts index e3643a3bcf..6404e72c68 100644 --- a/cli/template/extras/src/server/better-auth/config/with-prisma.ts +++ b/cli/template/extras/src/server/better-auth/config/with-prisma.ts @@ -1,5 +1,6 @@ import { betterAuth } from "better-auth"; import { prismaAdapter } from "better-auth/adapters/prisma"; +import { nextCookies } from "better-auth/next-js"; import { env } from "~/env"; import { db } from "~/server/db"; @@ -18,6 +19,8 @@ export const auth = betterAuth({ redirectURI: "http://localhost:3000/api/auth/callback/github", }, }, + // Make sure nextCookies() is the last plugin in the array + plugins: [nextCookies()], }); export type Session = typeof auth.$Infer.Session;