When calling auth.api.listUsers on the server. I'm getting an API error:
Failed to fetch users: [Error [BetterCallAPIError]: API Error: UNAUTHORIZED ] { status: 'UNAUTHORIZED', headers: Headers {}, body: [Object]} GET /admin 200 in 621ms GET /admin 404 in 700ms
Failed to fetch users: [Error [BetterCallAPIError]: API Error: UNAUTHORIZED ] { status: 'UNAUTHORIZED', headers: Headers {}, body: [Object]} GET /admin 200 in 621ms GET /admin 404 in 700ms
oddly enough if i just fetch the api route directly:
await betterFetch("/api/auth/admin/list-users")
await betterFetch("/api/auth/admin/list-users")
This works just fine. Granted I'm populating the Cookies on the headers explicitly. But to the best of my knowledge that isn't the issue the cookies seem to be getting set properly in either case, because I'm able to make every other type of request. Just not sure if its my config or something else.