prtclP
Convex Community2y ago
6 replies
prtcl

Auth in PWA/Capacitor

Hey gang, I've been developing an app with Convex using Clerk auth, following the docs to set up a users table and sync on login. Everything has been awesome except that I've hit a snag when setting up PWA features.

When running the app as PWA, any time its in the background (swiping away, switching to native camera to take a photo, etc) the app suspends and then resumes, causing Clerk and Convex auth to spin through a loading state to refresh the token. This in turn causes the whole app to isLoading and the user to lose state.

Is there a way to prevent this refresh cycle? Ive dug through the docs and library code and don't see anything obvious. Thanks!
Was this page helpful?