3 Comments
User's avatar
Jose Toscano's avatar

Very clean and simple implementation, great job! Just gave it a try and I'm kind of struggling with using the current session for the trpc query call. Since the `featureFlagsQueries` is built as a "protectedProcedure" how can the current user's session be included in the call. Should it be handled through the "createContext()" builder?

Daniel Garcia's avatar

If you'd like, I can share a straightforward repository that includes the necessary context. I'm currently utilizing a Clerk context for authentication, which is why you may notice the protected procedure.

Jose Toscano's avatar

Repo would be nice 👏. I'm using nex-auth, but I am using a built-in function as middleware just to validate the session for protected procedures. I could make the router "public", but then the user's id should be included as a parameter. I do think that the way to go is using the current authenticated user.