-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remix.run Clerk SDK server functions not returning permissions, roles, organization info, etc... #3211
Comments
Hey @LumDermaku, I quickly wanna mention that not receiving any of Thanks for providing us with the reproduction repo. I used both The reason you were seeing a 401 error with v3 was probably dues not declaring and using the ClerkErrorBoundary |
Thank you for your reply @panteliselef. I have added a custom prop in the session token Since For the Error Boundary, I've already tried implementing it but was still having the error. Someone from your team already recommended to upgrade to the latest beta which fixes that issues. |
So with clerk, you need to specify an active organization. Easiest way to do this would be to mount the OrganizationSwitcher component and select or create an organization from the UI. We also have this guide on how to "force" users into an organization, in case your app would only work with a populated orgId. Have a look here |
@panteliselef the link you provided has a Next.js example, and for this section, there's a server example and client example. Both assume that you get an Either I am doing something wrong with Clerk dashboard setup or the Remix SDK is not working. I even created a custom role now, assigned my custom permission to it; Added a new user to my Org and assigned this custom role to it. Still not getting even an Thank you for your time. |
@panteliselef I used the Before I begin writing the logic to automatically set one of the orgs as Active by default (this is our case), the docs say that the user will automatically have an org set as Active as soon as they accept the invitation. What type of invitation in this case? Email invites? I didn't accept any email invitations when I added an email of mine to my Org. There will only be one Custom org that I need some specific users to be part of, and everyone added there should have it set as Active, without having to manually choose an org from our web app since this is kind of a deal breaker. |
@panteliselef
|
Hey @panteliselef I have the same problem, on the client side I get the user but is always null if I call is this the cause of the issue? tx |
Hey @eliawk, if |
Preliminary Checks
Reproduction
https://github.com/LumDermaku/remix-clerk-bug
Publishable key
pk_test_bmF0aXZlLWNvdy01NS5jbGVyay5hY2NvdW50cy5kZXYk
Description
I cannot get any "custom" user info (org-related like permissions, roles, org itself) through Clerk SDK's server-related functions, such as
getAuth
from@clerk/remix/ssr.server
as described by Clerk docs here.Not even the `` component works when i pass my custom permission in the
permission
prop. I made sure to copy-paste it from the Clerk dashboard. Same applies to roles.The only way I can get all user info from Clerk is through client-components hooks, like
useUser
'sgetOrganizationMemberships()
method, which returns all the correct info from Clerk, but for the moment I cannot use this when I can use `` for getting the user Info from the client-side, orgetAuth
from server-side which is even better for me.I have also customized the session token with the following:
"{permissions": "{{org_membership.permissions}}"}
The project is on
Remix.run v2
withVite v5.1.0
onNode.js v20.11.0
, withClerk/Remix 4.0.0-beta.43
. I have to use the beta version otherwise I'll get that infamous Error 401 issue when running onv3.2.3
Steps to reproduce:
getAuth
in a loader, and also the `` component even though in this case if you use one you don't need the other:Expected behavior:
Based on the codebase (check the github repo)
On the server console.logs, i should get:
Actual behavior:
On the client using the
useUser()
hook, i am successfully getting all the signed-in user's info from Clerk.Environment
The text was updated successfully, but these errors were encountered: