Update session on hooks
Hello everyone, I'm trying to update a session (only if the user logged in with google or github) this is the code
const auth = betterAuth({
session
and ctx.context.session
are always null.... how can I update the session if the user came from social login?3 Replies
i think its newSession and newUser
Hooks | Better Auth
Better Auth Hooks let you customize BetterAuth's behavior
newSession works, but I'm not able to update the session
I've found the issue...
1. Use
ctx.context.newSession
2. Use newSession.session.token
to update the session
this is the code that works