nowaythatworked/auth-astro

getUserByAccount is not a function when trying to use an adapter

Closed this issue · 1 comments

[auth][error][CallbackRouteError]: Read more at https://errors.authjs.dev#callbackrouteerror
[auth][cause]: TypeError: getUserByAccount is not a function
    at Module.callback (file:///D:/Coding/auth-astro-test/node_modules/@auth/core/lib/routes/callback.js:35:45)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AuthInternal (file:///D:/Coding/auth-astro-test/node_modules/@auth/core/lib/index.js:64:38)
    at async Proxy.Auth (file:///D:/Coding/auth-astro-test/node_modules/@auth/core/index.js:100:30)
    at async eval (/node_modules/auth-astro/server.ts:44:17)
    at async Module.get (/node_modules/auth-astro/server.ts:65:14)
    at async call (file:///D:/Coding/auth-astro-test/node_modules/astro/dist/core/endpoint/index.js:72:20)
    at async call (file:///D:/Coding/auth-astro-test/node_modules/astro/dist/core/endpoint/dev/index.js:15:10)
    at async handleRoute (file:///D:/Coding/auth-astro-test/node_modules/astro/dist/vite-plugin-astro-server/route.js:117:20)
    at async run (file:///D:/Coding/auth-astro-test/node_modules/astro/dist/vite-plugin-astro-server/request.js:46:14)
[auth][details]: {
  "provider": "github"
}

I'm trying to set up the Email provider in Auth.js which requires a database adapter to work. No matter what adapter I try or settings I mess with I can't seem to get it to run though.
Here is the repo I've been working in if that would help at all. There is a good chance I'm just doing something wrong, this is my first time really messing with setting up Auth.js on my own and not having another tool do it for me. Let me know if any other details are needed! https://github.com/MonsteRico/auth-astro-test

It looks like the adapter is not being properly given to auth.js, its just empty.