Session extension isn't happening with Chrome Extension SW + Fastify Setup
Love the simplicity of the setup. however, I am facing an issue with my current Chrome Extension (service worker) + Fastify & Prisma development.
I am using the Email & Password authentication.
the signin, signup and signout functionality are working perfectly.
however, strange thing I noticed is that the client
getSession()
call for 'better-auth/client'
isn't increasing the session expiry. so, basically if the session expiresIn
is set to 120 and the updateAge
is set to 30 , then no matter how many times the getSession()
is called, the session expiry isn't extending, and becomes null after 120 seconds. in the network calls also I didn't observe anything except api/auth/get-session
calls.
I went through the entire documentation, but was unable to identify the fix and understand what exactly is considered as the "session is used" here : https://www.better-auth.com/docs/concepts/session-management#session-expiration
But whenever the session is used and the updateAge is reached, the session expiration is updated to the current time plus the expiresIn value.any help with this will be greatly appreciated. thank you.
Session Management | Better Auth
Better Auth session management.
1 Reply
fastify auth.js
chrome extension (plain js) auth-client.js