T
TanStack11mo ago
extended-salmon

how to set auth session duration with Convex auth in tanstack start

I set Convex Auth in Tanstack start but have to login every few minutes when I reload the page. How to set up dev so the login session lasts 30 days?
11 Replies
foreign-sapphire
foreign-sapphire11mo ago
@ballingt can you help out here?
flat-fuchsia
flat-fuchsia11mo ago
@Gorka Cesium what's your integration look like?
extended-salmon
extended-salmonOP11mo ago
using Magic Link with Resend, Tan Start, I added the <ConvexAuthProvider> in router.tsx I see the behavior on my local dev in Chrome and Safari
flat-fuchsia
flat-fuchsia11mo ago
Oh Convex Auth huh, hm I haven't tried it yet. I'm not sure what would cause this, can you tell if the JWT is being lost from localstorage or is being submitted but it's expired? Could you whip up an example? I'm working on Clerk now, saving Convex Auth for next.
extended-salmon
extended-salmonOP11mo ago
yeah i'll put something together I did see the AuthRefreshToken getting lost from localstorage maybe it gets deleted when it signs out automatically.. That is what i would like to prevent in the db it shows the expiration valid for one month
extended-salmon
extended-salmonOP11mo ago
here it is https://github.com/vasco3/convex-tanstack-start-with-auth although in this case the refreshToken seems to persist. I'll let you know if i figure out how to reproduce the issue
GitHub
GitHub - vasco3/convex-tanstack-start-with-auth: Tanstack Start app...
Tanstack Start app with Convex and Convex Auth. Contribute to vasco3/convex-tanstack-start-with-auth development by creating an account on GitHub.
flat-fuchsia
flat-fuchsia11mo ago
awesome, thanks
extended-salmon
extended-salmonOP11mo ago
i forked your repo so it would be easier
flat-fuchsia
flat-fuchsia11mo ago
I forget if I shared already, there's adding Convex to the Clerk demo — could be some similarities https://github.com/thomasballinger/start-clerk-basic-with-convex/pull/1 oh I think I did already ok I'll take a look at this soon, hoping to have a clerk + convex and a convex auth demo both out this week
extended-salmon
extended-salmonOP11mo ago
nice your implementation looks more thorough.
flat-fuchsia
flat-fuchsia11mo ago
there are definitely issues, will update when I've got something that works the goal is to make sure SSR hydration works well, after that initial load it should work like any client-side app

Did you find this page helpful?