Repetead API post calls
I'm having a problem with the admin plugin. I check userHasPermission in a client component view selector. I keep getting this repeated post requests.
POST /api/auth/admin/has-permission 200 in 179ms 100+ of these lines and its not stopping,
1 Reply
My code looks like
checkPermissions is a server function calling auth.api.getSession and auth.api.userHasPermission:
The issue was that the checkPermission is serverAction that had to run on every ClientComponent mount. The better approach is to use client side useSession or getSession. This way it uses nanostore so id doesnt have to hard check it every time.