apity icon indicating copy to clipboard operation
apity copied to clipboard

`FetchConfig:use` middleware currently unused

Open bddvlpr opened this issue 1 year ago • 2 comments

Great project so far, works perfectly for my projects. Only feature it's missing is a middleware provider. I've noticed there's a config to apply middleware, yet it's unused as far as I can tell. Is this feature still planned?

bddvlpr avatar Jul 25 '23 18:07 bddvlpr

Hi @bddvlpr, thanks for the feedback. Can you describe how exactly do you want to use middlewares with Apity? Or maybe give an example of such middleware. It will help us to provide a better answer or even implement it.

fbjorn avatar Sep 18 '23 07:09 fbjorn

For example, catching when a user is unauthorized for all API calls; every call has a possibility to throw a 401 when the user's token is expired. Using a middleware this could be handled and catched without having to define it for each individual request.

bddvlpr avatar Sep 19 '23 10:09 bddvlpr