-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Adding headers to endpoint requests #838
Comments
Thank you for the issue. I've been in general considering if we could add something similar to AuthJS callbacks so that any developers are able to customize all the aspects of the outgoing request for a local/refresh provider. It seems to be quite a requested feature in one way or another. I will give it some thought and try to come up with a good extensible solution similar to |
Would it be possible to also add the solutions proposed by @AidosMarcos for simpler and more straightforward use-cases (ie. to support httpOnly cookies)? I can work on it today if it's not a problem |
Related issue: #722 |
Not sure if this is helpful, but I am using the
And, in looking at the code, there is a
You should be able to call it with:
|
I'm also facing with this issue, this solution would solve most of my problems 🤞🏼 (my developer problems) |
Context
using nuxt-auth with local external provider and my external API demans an 'ApiKey' header to authorize any request to be made.
So far i was unable to find a way to had custom header to the endpoints defined in nuxt-auth config, Is there any way to do this?
Already tried creating plugin trying to "catch" fetch request and manually add header but does not seem to work with fetch call made by nuxt-auth.
Describe the feature
Possibility to add request headers to defined endpoints.
How would you implement this?
Add another prop do the object that defines endpoint like:
endpoints: { signIn: { path: 'login', method: 'post', headers: { ... } }, signOut: { path: 'logout', method: 'post', headers: { ... } }, signUp: { path: 'register', method: 'post', headers: { ... } }, getSession: { path: 'session', method: 'get', headers: { ... } }, }
Additional information
Provider
The text was updated successfully, but these errors were encountered: