tRPC with Supabase Auth
I am unable to sign in as I am trying to set up my project with tRPC. Here is the procedure where I am making the call:
Even though this runs without any errors, there is no session/cookie in the browser.
I think this may be because Nextjs does not allow usage and setting of cookies outside of server actions and route handlers.
What can I do to get around this?
8 Replies
Build a User Management App with Next.js | Supabase Docs
Learn how to use Supabase in your Next.js App.
This uses server actions. I am trying to set up auth with trpc.
Oh, and you cant combinate like that? its more safety
I know it will work with server actions because it was already working just fine. I am deliberately moving to tRPC. There are some features of tRPC that I want to take advantage of.
And this?
As far as I can tell, this wont work either because Nextjs does not allow usage of cookies outside route handlers and server actions.
Hmm, you have two options i think, local, not safe:
Or next one is create API route
I am also leaning towards the second but I am hoping someone who has used tRPC can chime in and mention some clever workaround.