Http Action no authentication

export const generateUrlForToken = httpAction(async (ctx, request)=>{
    const identity = await ctx.auth.getUserIdentity();
    
    if(identity == null){
        return new Response("No identity found",{
            status:401,
            headers:{
                "Access-Control-Allow-Origin": process.env.CLIENT_ORIGIN,
                "Vary": "origin",
            }
        });
    }
});


The identity keeps returning null in my http action. I plugged in the Auth0 access token in the request header as shown below.
const link = await (await fetch("https://blablabla.convex.site/tiktokAuth", {
            method:"GET",
            headers: { Authorization: `Bearer ${await getAccessTokenSilently()}` }
        })).text();

And I see in the network tab that it does send over the Authorization header and I logged it in the http action and it does send over. But for some reason I never get the identity object.

Thanks for ur guys help
Was this page helpful?