Closed mintydev789 closed 2 weeks ago
I should also mention I consume the output of the function directly in my client-side React code using canAccessModDashboard.data
. I end up having a hydration error (seemingly because it's actually returning correctly while React does the initial render server-side (I'm using Next JS).
Is this suited for github?
To Reproduce
I am following the documentation for checking if the user has a given permission, but the promise returns a 401 no matter what (I have tried logging in with an admin account, but that still results in
canAccessModDashboard
returning 401). This is the setup I have:It's also possible that it works correctly, but I'm doing something wrong due to the documentation being somewhat unclear. For completeness, here is also my
permissions.ts
setup:Current vs. Expected behavior
The function always returns a 401. It should not do so when the user has the specified permissions.
What version of Better Auth are you using?
1.2.7
Provide environment information
Which area(s) are affected? (Select all that apply)
Client
Auth config (if applicable)
Additional context
No response