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

Be able to affect server-side headers in the event handler #92

Open
1 of 3 tasks
mishu- opened this issue Nov 21, 2024 · 1 comment
Open
1 of 3 tasks

Be able to affect server-side headers in the event handler #92

mishu- opened this issue Nov 21, 2024 · 1 comment

Comments

@mishu-
Copy link

mishu- commented Nov 21, 2024

Describe the feature

I am trying to set a Bearer token that I only obtain server-side after module initialization, so any nuxt.config.ts options are definitely not an option.
In order to be able to take advantage of the client side composable and not have to redefine all my endpoints on the server side solely to redo what runtime/server/handler.ts already does I think I might need a hook of some sort that I can use to modify the proxied requests headers on server side just before sending the request to the backend api.

any pointers on this matter are very welcomed!

Additional information

  • Would you be willing to help implement this feature?
  • Can you think of other implementations of this feature?

Final checks

@bodgerbarnett
Copy link

I am looking for something like this as well.

I need to pass my Authorization header in based on the value of the token from useAuth at runtime but there doesn't seem to be any way of doing this. I've tried passing it in every onRequest method (which would not be ideal but I wanted to see if it would work) but it doesn't seem to allow it.

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

No branches or pull requests

2 participants