WorkOS token refresh breaks Convex
I've got a NextJS app where when the token from WorkOS effectively is refreshed, the Convex connection stops working until I do a refresh of the page. If I browse between items on my navbar, it doesnt work, and convex simply says 'Convex auth - getUserIdentity returned: null and 'No identity found - user not authenticated'
Is this a known issue and does anything have any immediate gotchas that I should look at?
Below is my auth.config.ts:
const clientId = "client_XXXXXX";
const authConfig = {
providers: [
{
type: 'customJwt',
issuer:
https://api.workos.com/,algorithm: 'RS256',
applicationID: clientId,
jwks:
https://api.workos.com/sso/jwks/${clientId},},
{
type: 'customJwt',
issuer:
https://api.workos.com/user_management/${clientId},algorithm: 'RS256',
jwks:
https://api.workos.com/sso/jwks/${clientId},applicationID: clientId,
},
],
};
export default authConfig;
