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,
},
});
};
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?
2 Replies
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Nick/Roal
Nick/RoalOP4mo ago
Thank you. The docs only mentioned the headers with the getSession api.

Did you find this page helpful?