supabase-js
supabase-js copied to clipboard
List all users (auth schema) not working with local environment
When attempting to load all users from the auth schema using the provided code snippet, the expected behavior is to fetch users from the Supabase environment. However, it appears that the code functions properly in the production environment but fails to retrieve users in the local environment.
useEffect(() => {
const getUsers = async () => {
const {
data: { users },
error,
} = await supabase.auth.admin.listUsers();
console.log({ users });
};
getUsers();
}, []);
Upon investigation, the code block utilizing await supabase.auth.admin.listUsers() is intended to fetch users. However, in the local environment, it does not yield the expected results.
Are you using "service_role" key or just "anon"?
Are you using "service_role" key or just "anon"?
@Tananga yes I am using service_key_role