© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
6 replies
Aaron Me

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;
};
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"'
}
{
  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
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Invalid Jwt
SupabaseSSupabase / help-and-questions
6d ago
invalid jwt
SupabaseSSupabase / help-and-questions
2w ago
Invalid JWT
SupabaseSSupabase / help-and-questions
2mo ago
Edge function giving Invalid JWT
SupabaseSSupabase / help-and-questions
7mo ago