© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
galizar

Basic query works in V1 but not in V2

I am trying to migrate to V2 and I realized the queries were not working at all with V2, so I set up this two test functions:

V1:
type group = Database['public']['Tables']['groups']['Row'];

const supabase = createClient(url, anonKey);

const propColumns = 'name, isTrashed:is_trashed';

(async () => {
    await supabase.auth.signIn({email, password});

    const props = 
        await supabase
            .from<group>('groups')
            .select(propColumns);

    console.log(props);

})();
type group = Database['public']['Tables']['groups']['Row'];

const supabase = createClient(url, anonKey);

const propColumns = 'name, isTrashed:is_trashed';

(async () => {
    await supabase.auth.signIn({email, password});

    const props = 
        await supabase
            .from<group>('groups')
            .select(propColumns);

    console.log(props);

})();


V2:
const supabase = createClient<Database>(url, anonKey);

const propColumns = 'name, isTrashed:is_trashed';

(async () => {
    await supabase.auth.signInWithPassword({email, password});

    const props = 
        await supabase
            .from('groups')
            .select(propColumns);

    console.log(props);
})();
const supabase = createClient<Database>(url, anonKey);

const propColumns = 'name, isTrashed:is_trashed';

(async () => {
    await supabase.auth.signInWithPassword({email, password});

    const props = 
        await supabase
            .from('groups')
            .select(propColumns);

    console.log(props);
})();


And indeed, the V1 version works as expected, but the V2 one does not return the correct data, it's
undefined
undefined


I've taken a look at the logs in the app page and there's this key difference in there:

V1:
  "sb": [
    {
      "auth_user": "e92a8280-9d20-4dd9-9c0f-40c441810c41"
    }
  ],
  "search": "?select=name%2CisTrashed%3Ais_trashed",
  "url": "https://app url/rest/v1/groups?select=name%2CisTrashed%3Ais_trashed"
  "sb": [
    {
      "auth_user": "e92a8280-9d20-4dd9-9c0f-40c441810c41"
    }
  ],
  "search": "?select=name%2CisTrashed%3Ais_trashed",
  "url": "https://app url/rest/v1/groups?select=name%2CisTrashed%3Ais_trashed"


V2:
  "sb": [],
  "search": "?select=name%2CisTrashed%3Ais_trashed",
  "url": "https://app url/rest/v1/groups?select=name%2CisTrashed%3Ais_trashed"
  "sb": [],
  "search": "?select=name%2CisTrashed%3Ais_trashed",
  "url": "https://app url/rest/v1/groups?select=name%2CisTrashed%3Ais_trashed"


It seems like the client isn't authenticated with V2, so RLS is doing its job. Is there something I'm missing regarding
signInWithPassword
signInWithPassword
? The way it is talked about in the release notes sounds like it should be a swap in replacement and a quick look at the source seems to confirm that it does basically the same thing as v1's
signIn
signIn
. Would greatly appreciate any pointers
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

signInWithPassword does not sign in in v2, but signin in v1 works fine
SupabaseSSupabase / help-and-questions
4y ago
Cgroups v2 compatibility after removing cgroups v1 in openshift
SupabaseSSupabase / help-and-questions
4w ago
Authentication session works in front but is not available in the end
SupabaseSSupabase / help-and-questions
14mo ago
login works on localhost but not on netlify
SupabaseSSupabase / help-and-questions
4y ago