signup email from sever

I’m calling auth.api.signupWithEmail, and I’m getting the same response as when I call it from authClient.
However, the next getSession call returns null, whereas when signup is called from the client, it works fine.
I went through the method flow but didn’t find anything unusual.
4 Replies
nikatune
nikatune2mo ago
use headers headers:await headers()
Rupesh
RupeshOP2mo ago
thanks for the reply. where to put this.
Ping
Ping2mo ago
Are you making sure that the cookies are getting sent to the client? We usually recommend using authClient for these types of reasons
nikatune
nikatune2mo ago
const session = await auth.api.getSession({headers:await headers()}) client : const session = await authClient.getSession({ headers : await headers() })

Did you find this page helpful?