Having trouble getting user in Next JS 14 route handler

I am trying to get a user with the following code

import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs";
import { cookies } from "next/headers";
import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest) {
  console.log("GETTING USER");
  const supabase = createRouteHandlerClient({ cookies });
  const sesion = await supabase.auth.getUser();
  console.log(sesion);
  return NextResponse.json({ status: "testing" }, { status: 200 });
}

which I think should be valid however I keep getting the response

  data: { user: null },
  error: AuthApiError: invalid claim: missing sub claim

Is there something I am not doing or something I am misunderstanding?
Was this page helpful?