I'm using convex in my nextjs app for authentication. I have recently upgraded to latest [email protected], latest [email protected] and latest @clerk/[email protected]. To make authenticated requests to Convex during server rendering, I retrieve to token using the below code from the documentation (see https://docs.convex.dev/client/react/nextjs/server-rendering):
export async function getAuthToken() {
return (await (await auth()).getToken({ template: "convex" })) ?? undefined;
}
But I'm observing that this code systematically returns undefined even after I have successfully authenticated. This behavious is only observed in production, not in dev mode. This code used to work. It broke after above upgrade. The latest @clerk/nextjs` has introduced some breaking changes. Could these changes, perhaps, have broken the integration between clerk-next-convex?