diff --git a/package.json b/package.json index b3554b1..d1c2ea2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-jd-app", - "version": "1.0.104", + "version": "1.0.105", "main": "dist/index.js", "scripts": { "test": "ts-node -r tsconfig-paths/register src", diff --git a/src/helpers/utils/getIndexPage.ts b/src/helpers/utils/getIndexPage.ts index f66650b..0c39262 100644 --- a/src/helpers/utils/getIndexPage.ts +++ b/src/helpers/utils/getIndexPage.ts @@ -47,7 +47,7 @@ import { authClient } from "~/utils/auth";` : "" }${ useNextAuth - ? `\nimport { getSession } from "@solid-auth/next/session";\nimport { authOpts } from "./api/auth/[...solidauth]";\nimport { signIn, signOut } from "@solid-auth/next/client";` + ? `\nimport { getSession } from "@solid-auth/next";\nimport { authOpts } from "./api/auth/[...solidauth]";\nimport { signIn, signOut } from "@solid-auth/next/client";` : "" } ${ diff --git a/src/installers/NextAuth/files/prisma-handler.txt b/src/installers/NextAuth/files/prisma-handler.txt index 186add0..c154fd0 100644 --- a/src/installers/NextAuth/files/prisma-handler.txt +++ b/src/installers/NextAuth/files/prisma-handler.txt @@ -13,6 +13,12 @@ export const authOpts: SolidAuthConfig = { clientSecret: serverEnv.GITHUB_SECRET, }), ], + session: { + strategy: "database", + generateSessionToken: () => { + return crypto.randomUUID(); + }, + }, debug: false, }; diff --git a/src/installers/tRPC/utils/getTrpcContext.ts b/src/installers/tRPC/utils/getTrpcContext.ts index 9f196ed..a6f80b1 100644 --- a/src/installers/tRPC/utils/getTrpcContext.ts +++ b/src/installers/tRPC/utils/getTrpcContext.ts @@ -9,7 +9,7 @@ import type { createSolidAPIHandlerContext } from "solid-start-trpc";${ usePrisma ? `\nimport { prisma } from "~/server/db/client";` : "" }${useSolidAuth ? `\nimport { authenticator } from "../auth";` : ""}${ useNextAuth - ? `\nimport { getSession } from "@solid-auth/next/session";\nimport { authOpts } from "~/routes/api/auth/[...solidauth]";` + ? `\nimport { getSession } from "@solid-auth/next";\nimport { authOpts } from "~/routes/api/auth/[...solidauth]";` : "" }