T3 Next Auth / TRPC Documentation is outdated
I noticed t3 is using next-auth v4 instead of v5 (makes sense, 5 is in beta still).
But reading through the docs is still confusing since the links are between v4/v5 and next pages/app router.
Does anyone have any reliable sources/examples for a next-auth v5 t3 implementation?
3 Replies
I just didn't choose authjs in the cli and followed auth js documentation. Maybe you could do the same?
The next auth docs are wildly different regarding folder structure than t3 app especially between v4 and v5. It seems from the docs t3 is fairly opinionated about the folder structure and how it integrates trpc/middleware so having an idea of how you had linked everything would be helpful since the create t3 app doesn't work out of box with drizzle
I just put it inside server/auth just like t3, and Im also using drizzle. I think that you need to add the adapter when you want to use oauth.
You can integrate it with trpc middleware by going to /server/api/trpc.ts then import auth from your nextauth.
just like this, and it will be available on the ctx. here's how you create a protected procedure