-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature Request: Support for Interceptors in API Calls #8
Comments
Thanks so much for your kind words and thoughtful feedback. I’m really glad you’ve found the Regarding your request for request/response interceptors—good news! The module already provides flexibility for such customizations through How to Use
|
Hi @hkp22, thanks for your response! I appreciate the flexibility provided by In some other Sanctum authentication modules (e.g., export default defineAppConfig({
sanctum: {
interceptors: {
onRequest: async (app, ctx) => {
ctx.options.headers.set('X-Localization', app.$i18n.localeProperties.value.code);
},
},
},
}); This allows developers to automatically apply custom headers, logging, or request modifications without adding Would you consider adding support for this approach? It would greatly improve developer experience and keep API calls cleaner. |
@Velman04 That's a great suggestion, and I truly appreciate the thoughtful insight. Support for global interceptors in I've noted this feature request and will consider it for a future update. At the moment, I have some other priority tasks to handle. However, I'll definitely look into adding this feature once I get free time. Thanks again for your valuable feedback and support! 🚀 |
@qirolab Thanks for your response! 🚀 I really appreciate your consideration of this feature. Since I found it quite useful, I decided to implement it myself. I have developed and tested the support for global interceptors in Let me know if you have any feedback or suggestions! Looking forward to your review. 🚀 |
Hello, and thanks for your great work on this module!
I’ve been using nuxt-sanctum-authentication in my Nuxt 3 project and I find it very helpful. However, I noticed that some other similar modules (e.g., nuxt-auth-sanctum) provide support for request/response interceptors in API calls.
Interceptors allow for additional flexibility, such as:
X-Localization
,Accept-Language
)Here is an example of how this is implemented in nuxt-auth-sanctum via
app.config.ts
:Would you consider adding a similar interceptor system to nuxt-sanctum-authentication? This would allow developers to customize their API requests more efficiently.
Thanks in advance for your time and consideration! 🚀
The text was updated successfully, but these errors were encountered: