auth.api.listUsers returns UNAUTHORIZED but I am admin

Hello,
I have written this function
export const getUserList = async () => {
    return await auth.api.listUsers({
        query: {
            limit: 10,
        },
    });
};

But the API returns
[Error [BetterCallAPIError]: API Error: UNAUTHORIZED ] {
status: 'UNAUTHORIZED',
headers: Headers {},
body: [Object],
digest: '3161027971'
}

When I use auth.api.getSession I see that my account has role: 'admin'. What is the Problem?
Was this page helpful?