T3App session not set
Spun a new app with AppRouter, NextAuth, TRPC and prisma with sqlite, have added my discord auth and can confirm working (can see session in db).
However session is still undefined and have no idea why. I can technically fix it by adding
SessionProvider
but I dont think this is the right choice when using AppRouter.
Thanks!4 Replies
you mean session is undefined on clientside or on server?
if you want to obtain it clientside you need sessionprovider
serverside you just call
both actually, the session callback never got called
but afaik when using app router I can just call
const session = await auth()
no?when calling from server component
but on client component you need to use useSession() hook
i think src/app/page.tsx is a server component?