My auth client on the frontend is defined this way. super simple:
import { createAuthClient } from 'better-auth/svelte';import { PUBLIC_API_URL } from '$env/static/public';import { adminClient, apiKeyClient, usernameClient} from 'better-auth/client/plugins';export const authClient = createAuthClient({ /** The base URL of the server (optional if you're using the same domain) */ baseURL: PUBLIC_API_URL, plugins: [adminClient(), apiKeyClient(), usernameClient()], basePath: '/auth'});
import { createAuthClient } from 'better-auth/svelte';import { PUBLIC_API_URL } from '$env/static/public';import { adminClient, apiKeyClient, usernameClient} from 'better-auth/client/plugins';export const authClient = createAuthClient({ /** The base URL of the server (optional if you're using the same domain) */ baseURL: PUBLIC_API_URL, plugins: [adminClient(), apiKeyClient(), usernameClient()], basePath: '/auth'});
I have sign in and sign out working fine but when I call
listUsers
listUsers
it sends back this:
{code: 'YOU_ARE_NOT_ALLOWED_TO_LIST_USERS', message: 'You are not allowed to list users', status: 403, statusText: 'Forbidden'}
{code: 'YOU_ARE_NOT_ALLOWED_TO_LIST_USERS', message: 'You are not allowed to list users', status: 403, statusText: 'Forbidden'}
I've looked at the docs and even other peoples' situations, some said to update so I updated to v1.4.5 on the client and server to no avail. I'm not sure what to do but ask for a hand.