Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List all users (auth schema) not working with local environment #1007

Closed
Tahaaskari97 opened this issue Apr 3, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@Tahaaskari97
Copy link

Tahaaskari97 commented Apr 3, 2024

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.

@Tahaaskari97 Tahaaskari97 added the bug Something isn't working label Apr 3, 2024
@Tahaaskari97 Tahaaskari97 changed the title List all users (auth schema List all users (auth schema) not working with local environment Apr 3, 2024
@Tananga
Copy link

Tananga commented Apr 9, 2024

Are you using "service_role" key or just "anon"?

@Tahaaskari97
Copy link
Author

Tahaaskari97 commented Apr 15, 2024

Are you using "service_role" key or just "anon"?

@Tananga yes I am using service_key_role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants