Comments (6)
Hey @LumDermaku, I quickly wanna mention that not receiving any of org:sys_*
permissions from getAuth()
is expected. Only your custom permissions should be returned from there.
Thanks for providing us with the reproduction repo. I used both @clerk/remix@3
and the @clerk/remix@beta
I could not replicate, posting an image as example below.
The reason you were seeing a 401 error with v3 was probably dues not declaring and using the ClerkErrorBoundary
from javascript.
Thank you for your reply @panteliselef.
I actually need only custom permissions returned by getAuth()
, but still I am not getting the same response like yours, not even orgId
, or the default orgPermissions
. Maybe something is wrong with Clerk's dev environment? Not sure if my pub key can help.
I have added a custom prop in the session token "{permissions": "{{org_membership.permissions}}"}
but I am still getting null
for that.
Since getAuth
in loaders seem to work for you, is the <Protect>
component also working? I am sure my user has the needed permissions since with the client-side useUser()
hook I can see all permissions, including the custom ones.
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.
from javascript.
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
from javascript.
@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 orgId
prop out of the returned object, either from the auth()
server function (that looks like the Next.js version of getAuth()
for Remix) or from the useAuth()
hook.
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 orgId
from the server function.
.
Thank you for your time.
from javascript.
@panteliselef I used the <OrganizationList />
and selected the Org i created instead of the personal one. After i clicked it, refreshed the page, now the response from Clerk is looking good in console, just like your response.
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.
from javascript.
@panteliselef
I think we can somehow mark this as done or closed. For anyone interested in what i did:
I ended up writing that custom logic in a component that gets imported in root.tsx
. You can also do it in _index.tsx
component because it is rendered within the <Outlet />
of root.tsx
.
After the user signs-in, the homepage is loaded and that component does the following:
- invokes
useOrganizationList()
hook. - In a useEffect hook, i check if
userMemberships.data
array has an element who'sename
property is the same as the one i want. I invoke thesetActive()
function with the org id of the user's membership. Don't forget to add the objects, functions, variables in the dependency array of useEffect. - With a global state manager I set a boolean value which i use to render a button conditionally. In the useEffect hook i also have some custom logic to check whether the global state already has/doesn't have anything set.
from javascript.
Related Issues (20)
- V5: `OrganizationProfile` throws error upon logout HOT 15
- The ignore option for @clerk/upgrade is ignored HOT 5
- React Native Support HOT 1
- Deprecated prop `afterSignInUrl` at `ClerkContextProvider` instead of `fallbackRedirectUrl` or `forceRedirectUrl` HOT 2
- Incorrect Return Type for getAllowlistIdentifierList HOT 3
- Cannot remove divider above Privacy and Terms links in core-2 HOT 4
- Unable to Access users Property in Clerk SDK for Node.js v5.0.2 HOT 1
- `@clerk/nextjs` middleware redirection issue on login with email on chrome HOT 16
- [Node SDK]: Failed to resolve JWK during verification HOT 6
- Home Page not auto-redirecting to clerk auth page on localhost in "@clerk/nextjs": "^5.0.3" HOT 4
- `@clerk/upgrade` does not seem to work via yarn HOT 3
- Unable to add custom header when calling "isProtectedRoute". HOT 4
- forceRedirectUrl is not working when using SignInButton HOT 16
- Too many redirects on clerk.com (Dashboard AND docs) HOT 1
- React Native @clerk/clerk-expo is not working as expected HOT 20
- Sign out not working reliably in @clerk/nextjs v5 HOT 2
- [Next App Router] i18n not work on `clerkMiddleware` HOT 6
- I upgraded my app from version Expo SDK 50 to 51 and since then clerk has completely broken HOT 7
- Clerk core v2 - Clerk fails to load under cypress iframe - "Browser unauthenticated" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascript.