I was doing some Convex shaneningans
I was doing some Convex shaneningans today, and it took me a second.... but, is there a way to pass the active organization from Clerk to Convex auth so I can access it from the context?
16 Replies
Are you looking to migrate to convex auth? or just wondering if you can pass things down the ctx?
The second one. I'm using Clerk and I connected it to Clerk, but I would like to have the organizations available for some validations, specially the active organization
npm
convex-helpers
A collection of useful code to complement the official convex package.. Latest version: 0.1.104, last published: 19 days ago. Start using convex-helpers in your project by running
npm i convex-helpers
. There are 20 other projects in the npm registry using convex-helpers.this might help
Ah, I don't have prior knowledge about that!
It should be in the
o
claim on the jwt: https://clerk.com/docs/backend-requests/resources/session-tokens
So you should be able to do
May depend on jwt claims setup in your Clerk dashboard and whether or not you'r using v2 session token claimsMmm looks like identity doesn't have an
o
value, maybe that's just the autocompleteYeah maybe log it and see, might just be types
Ok, nope, it comes back undefined 😩
Hit your Clerk dashboard and check out your jwt template settings
It looks like you need to set which values are included. What I don't know for sure is whether any claims get stripped off coming through Convex. I believe custom claims has been a solved problem for some time though, so it should work.
I can customize them, but looks like the organization id always comes back as "default" even when I change between organizations 🤔
hmm
Oh no, the organization change crashes the useQuery function 😂
oh really?
What are you seeing
Yeah, I'll leave that for the next release 😂 right now I'm doing a challenge to launch an AI product in only 9 days, and today is the last day 😂
Good luck!
thanks 😄