Error on TRPC while fetching data inside Auth.ts
I'm using CredentialsProvider from next auth, and I need to fetch some data to check some data related to the user before I can authorize that user to log in.
I have a simple query inside the "authorize" callback, but this throws a TRPC:
Note that the query works fine when I run it in a server component, so I'm a bit unsure what could be the issue here.. Anyone has an idea?
Thanks in advance
1 Reply
Yeh basically it seems like any query within Auth.ts file gets rejected, but the error message is quite vague and it's gonna be hard to debug :/
I ended up getting rid of
api.
and just did the call from drizzle directly, this works..