Web Dev Cody
Web Dev Cody4mo ago

Simulate Convex Auth Invalid

I've noticed that sometimes when my users leave my site open for a while, their convex auth session becomes invalid. This usually means when a user clicks on a button, the mutation throws an auth error. Is there some standard way to handle this type of issue? It would be nice if there was a way to wrap useMutation or useQuery in custom logic to redirect the user if an auth error gets returned from my api.
3 Replies
jamwt
jamwt4mo ago
you could create a wrapper hook, I think? I'm not sure we have one at hand in convex-helpers or anything it's not a bad idea though
Web Dev Cody
Web Dev CodyOP4mo ago
yeah, I'll look into that
ballingt
ballingt4mo ago
curious what you come up with, we think we're covering most of these with automatic refresh (necessary so queries don't end up re-executing on the server and returning "user auth expired") so haven't done anything on mutations/actions, anything you find useful in the wild would be very interesting to hear about.

Did you find this page helpful?