© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Fucking Dennis

signInWithPassword does not sign in in v2, but signin in v1 works fine

I have a problem with the signin method in supabase-js.

If i call the signInWithPassword method with an email and password, the response i get has no errors and has a session and a user. However if i try calling getSession afterwards the session i get from it is null. I also have an rls policy set up on a table and if i try to select from the table i get 0 result as if i was not authenticated.

If i use v1 of supabase-js and use the signIn method, then i can select from the table just fine and get the results that i should. As far as i can see from the docs it does not looke like i am missing something.

const res = await supabase.auth.signInWithPassword({
      email: 'test@email.com',
      password: '12345678',
    });

    const { data, error } = await supabase
      .from('test')
      .select();
    
    expect(data?.length).toBe(1);
const res = await supabase.auth.signInWithPassword({
      email: 'test@email.com',
      password: '12345678',
    });

    const { data, error } = await supabase
      .from('test')
      .select();
    
    expect(data?.length).toBe(1);


Am i doing something wrong?
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

Basic query works in V1 but not in V2
SupabaseSSupabase / help-and-questions
4y ago
Google auth works fine in eastern europe but auth callback fails in US
SupabaseSSupabase / help-and-questions
2mo ago
hi did supabase-js v2 remove redirectTo from signInWithPassword function?
SupabaseSSupabase / help-and-questions
4y ago
Property 'signIn' does not exist on type 'SupabaseAuthClient'.
SupabaseSSupabase / help-and-questions
4y ago