© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
20 replies
doctor_eval

Can't login using js-v2 rc.10

So I upgraded to the RC version of JS - and now I can't log in from my code.

I'm playing around on my laptop at the moment so I just want to be able to log in using a hard coded email and password, and then use that session to make RPC calls to Supabase.

But my code isn't working. I wrote a database function to return the current user and role, and it's returning null and "anon".

Here's my login code. I'm sure it's something really stupid.

import {createClient} from "@supabase/supabase-js";

let client = createClient(
    'http://supabase.example.com/',
    'supabase-anon-api-key',
);

const { data, error } = await client.auth.signInWithPassword({
    email: 'user@example.com',
    password: 'random-password',
})

if (error != null) {
    throw error
}

let userinfo = await client
    .rpc('userinfo', {})

console.log("Got userinfo", userinfo)

// prints: {
//   error: undefined,
//   data: { uid: null, role: 'anon' },     <-- this should be role "authenticated"
//   count: undefined,
//   status: 200,
//   statusText: 'OK'
// }
import {createClient} from "@supabase/supabase-js";

let client = createClient(
    'http://supabase.example.com/',
    'supabase-anon-api-key',
);

const { data, error } = await client.auth.signInWithPassword({
    email: 'user@example.com',
    password: 'random-password',
})

if (error != null) {
    throw error
}

let userinfo = await client
    .rpc('userinfo', {})

console.log("Got userinfo", userinfo)

// prints: {
//   error: undefined,
//   data: { uid: null, role: 'anon' },     <-- this should be role "authenticated"
//   count: undefined,
//   status: 200,
//   statusText: 'OK'
// }
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

Can't re-login using Github
SupabaseSSupabase / help-and-questions
5mo ago
Can't login
SupabaseSSupabase / help-and-questions
2mo ago
can’t login!
SupabaseSSupabase / help-and-questions
4mo ago
Can’t login properly
SupabaseSSupabase / help-and-questions
7mo ago