getServerAuthSession returns null when using CredentialsProvider
i just started a new t3 app using the app router. i added just this to the providers array in the
authOptions
thats the only change i made to the t3 generated boilerplate. if i go to /api/auth/signin
, and even if i call the signIn
function with 'credentials'
as the first argument, it returns ok true, error null, and the next-auth.*
cookies are being created. so it seems to be working fine, but getServerAuthSession
inside server components still returns null always.
if i login with discord instead, it works fine, and getServerAuthSession
returns an object. so, any idea why? do i need to setup something else to make the credentials provider work?1 Reply
the client side function
getSession
also returns null
actually, the jwt token cookie is not being created, only the other two, my bad