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'
// }
Was this page helpful?