Skip to content
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

Context Extension not correctly typed #21

Open
1 task done
svengau opened this issue Jun 22, 2023 · 0 comments
Open
1 task done

Context Extension not correctly typed #21

svengau opened this issue Jun 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@svengau
Copy link

svengau commented Jun 22, 2023

Bug report

  • I have checked other issues to make sure this is not a duplicate.

Describe the bug

trpc middleware allows extending the context, in particular Context Extension.

See https://trpc.io/docs/server/middlewares#context-extension

To Reproduce

To reproduce, simply;

  1. add the isAuthenticated rule to the official example,
  2. and use it on one query (example findManyUser).
  3. In findManyUser, check ctx.user. It's still null.

Expected behavior

In findManyUser, ctx.user should be typed as a string

ps: Thanks for this awesome job, I come from the graphql world, and really appreciated the graphql-shield.

@omar-dulaimi omar-dulaimi added the bug Something isn't working label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants