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

Allow for tRPC authentication through headers/custom fetch, or whatever makes sense #394

Closed
1 of 2 tasks
goetzrobin opened this issue May 15, 2023 · 0 comments · Fixed by #441
Closed
1 of 2 tasks
Assignees

Comments

@goetzrobin
Copy link
Member

Which scope/s are relevant/related to the feature request?

Don't known / other

Information

Currently the tRPC client does not allow you to pass in custom headers or a custom fetch function to support authentication of the request through e.g. an JWT

Describe any alternatives/workarounds you're currently using

Don’t use auth 😔

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@goetzrobin goetzrobin self-assigned this May 15, 2023
goetzrobin added a commit that referenced this issue May 26, 2023
A tRPCHeaders signal is exposed to set/get the headers added
to each tRPC call. This allows us to, e.g. add an authorization
header that we can then use to create protected procedures that
can only be executed when the user is authorized.

closes #394
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant