Is there a way to set the session cookie on verify OTT?
I'm using the OTT plugin to embed the token in a QR link so users can easily open a link in their phone but I'd like to keep them signed in after that. As far as I can see, verifyToken doesn't set the session cookie. Is there a clean way to do this? I guess I can try to set the cookie myself, but I'd prefer if there's a clean way supported by better auth itself
3 Replies
Inspected a bit how you do it internally for other endpoints and came up with this hook. Can't help but feel that there must be a cleaner way 🙂

Okay, I just realized that setSessionCookie is actually exposed. My IDE didn't catch it and I didn't see it documented so i thought it was internal. I ended up with this, any concerns? Is there a better way?

Looks good to me.