What's the difference between the session and the token?
Heyo,
I've been trying to get better auth to work in a Nest environment.
I noticed that a call to signInEmail returnes a token, but I can't use the token to authenticate subesequent; If I register better auth as a direct handler into express, the cookie has an additional suffix.
The only way I found to get the actual cookie is to add
asResponse
and get the cookie from the returned headers.
Is there a better way of getting the rest of the token? Also wondering about the difference, why give different responses.1 Reply
I'm trying to figure out the same thing myself.
I'm just now adopting better auth into my stack and im wondering how i should use it with my already existing nestjs setup. Do I just use the useSession hook and get the id, then call my backend anyway? not really sure to be honest
and the whole as Response thing confuses me too