Replies: 6 comments 8 replies
-
I tried the following: Follow this: https://authjs.dev/reference/adapters/prisma And did not install created my import SvelteKitAuth from "@auth/sveltekit"
import GitHub from "@auth/core/providers/github"
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import { PrismaClient } from "@prisma/client"
const prisma = new PrismaClient()
export const handle = SvelteKitAuth({
adapter: PrismaAdapter(prisma),
providers: [GitHub({ clientId: GITHUB_ID, clientSecret: GITHUB_SECRET })],
}) Did the rest stuff for Prisma (schema, migrate, generate) After 16:38:06 [vite] page reload src/hooks.server.ts
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error Value of "this" must be of type Crypto {
message: 'Value of "this" must be of type Crypto',
stack: 'TypeError [ERR_INVALID_THIS]: Value of "this" must be of type Crypto\n' +
' at new NodeError (node:internal/errors:393:5)\n' +
' at randomUUID (node:internal/crypto/webcrypto:80:30)\n' +
' at callbackHandler (file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@auth+core@0.1.4/node_modules/@auth/core/lib/callback-handler.js:109:35)\n' +
' at async Module.callback (file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@auth+core@0.1.4/node_modules/@auth/core/lib/routes/callback.js:73:54)\n' +
' at async AuthHandlerInternal (file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@auth+core@0.1.4/node_modules/@auth/core/index.js:86:38)\n' +
' at async Proxy.AuthHandler (file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@auth+core@0.1.4/node_modules/@auth/core/index.js:216:30)\n' +
' at async respond (file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.1/node_modules/@sveltejs/kit/src/runtime/server/index.js:229:20)\n' +
' at async file:///Users/xxx/Code/SK-Auth-Variants/SK-AuthJS/node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.1/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:444:22',
name: 'TypeError'
} In the database (SQLite), the table Without the line: |
Beta Was this translation helpful? Give feedback.
-
I'm guessing this isn't ready yet, but more generally I was wondering if the next-auth providers are compatible with the new generalized |
Beta Was this translation helpful? Give feedback.
-
The solution to this is simple. Until they fix it just define a new
|
Beta Was this translation helpful? Give feedback.
-
It appears to be fixed in latest versions. Tested with: +"@auth/sveltekit": "^0.2.2",
+"@next-auth/prisma-adapter": "^1.0.6", |
Beta Was this translation helpful? Give feedback.
-
I'm still getting this error with |
Beta Was this translation helpful? Give feedback.
-
Fyi there is now an @auth/prisma-adapter and would recommend using that over next-auth/prisma-adapter. |
Beta Was this translation helpful? Give feedback.
-
How can i use
@auth/sveltekit
with Prisma?I found this doc: https://authjs.dev/reference/adapters/prisma
but it is not SvelteKit specific.
Thanks a lot for making
authJS
framework-agnostic :-)Beta Was this translation helpful? Give feedback.
All reactions