EleckE
Convex Community9mo ago
11 replies
Eleck

Could not validate token during sync with better-auth

Hi! I'm using better-auth as my external auth service (not using convex-better-auth component), powered by TanStack Start, and I'm using it to authorize requests to Convex functions. I've set it all up following the Custom JWT Provider, but when my application tries to connect to Convex and connects the sync websocket, I'm getting Could not validate token.
I've followed the Debugging Authentication doc multiple times, and I can't find the root cause. Yesterday, I could see the decoded token in the function, while getting this error. Today, without having changed anything related to auth, I'm not even getting the decoded token.
I don't see any valid reason for this error to come up. I'll post some more details in thread. Any idea?
You have followed one of our authentication guides but something is not working.
Debugging Authentication | Convex Developer Hub
Was this page helpful?