Invalid JWT

When trying to upload an Image to the bucket (Policy: Authenticated and (bucket_id = 'site-logos'::text)) I get a response "Invalid JWT" Any ideas?

import { supabaseClient
} from "@supabase/auth-helpers-nextjs";

const uploadSiteLogo = async (image, imageName, imageType) => {
  const { data, error } = await supabaseClient.storage
    .from("site-logos")
    .upload(imageName, decode(image), {
      cacheControl: "3600",
      upsert: true,
      contentType: imageType,
    });
  if (error) {
    throw error;
  }
  const response = { data, error };
  return response;
};

Error:
{
  statusCode: '401',
  error: 'Invalid JWT',
  message: 'new row violates row-level security policy for table "objects"'
}


I just moved from supabase-js to auth-helper-nextjs. this function works no problem with supabase-js
Was this page helpful?