-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AdapterError] NextAuth with Drizzle Adapter #12411
Comments
Hi @Maisaan , please take a look at this: |
Yes, been over that. Afaik, DrizzleAdapter is edge compatible, and i wish to use the database strategy because i want to have a finer control over the users, with permissions and roles. When you lazy initialise or split configs you loose database functionality and thats not how i want it. |
I encountered a similar error. I was able to resolve it after i removed the import of server side database interaction function from client side related hook. Hope this helps. |
That's good news! Could you please show me how you did it? Thanks! |
Hello @FabriBorgobello, I uploaded a branch I was implementing search feature, had to interact with database. Instead of directly using the database function (which caused the error for me as shown below), which is supposed to be used server side rather than client side, I implemented an api handler for it that indirectly works with the database function. |
Thanks a lot @xibluespider . I really appreciate it! |
Adapter type
@auth/drizzle-adapter
Environment
Reproduction URL
https://github.com/Maisaan/drizzle-adapter-error
Describe the issue
Getting the following errors when trying to access req.auth inside of middleware, when middleware file is deleted this works without errors. I want to setup basic auth redirects.
I have updated next-auth-example template with my code to recreate error
Instead of a middleware i am currently using an HOC to check if session exists and redirect to auth screen, this is not ideal but works for now.
How to reproduce
pnpm install
.env.local.example
npx drizzle-kit push
to update supabaseExpected behavior
Authenticate user and redirect to home screen
The text was updated successfully, but these errors were encountered: