You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I'm using this project for my android project. And I wanted to implement a JWT token middleware which will automatically refresh a JWT if it was expired and then continue with the response. Coming across the readme, I found out that beforeSend and afterReceive are planned and are in Todo.
Coming from Golang/TypeScript world, I'd suggest something like this:
webb.AddMiddlware(jsonMiddleware)
Middleware implements an interface with method handle() which receives the original request and the next handler function
Now middleware can choose to either call the next or entirely skip, or maybe even modify the original request before continueing. Let me know if that makes sense 🙂
This one will totally resolve the necessity of the following todos:
decorator/interceptor beforeSend - provide hooks to manipulate request before send
decorator/interceptor afterReceive - provide hooks to manipulate raw response after receiving it
Let me know if you'll be willing to accept PRs :)
The text was updated successfully, but these errors were encountered:
Sounds like a good idea.
I'm willing to accept PRs. Please use .addMiddleware instead of .AddMiddleware. In TypeScript, JavaScript and Java it's totally uncommon to name methods starting upper-case.
Would be nice if your PR contains unit-tests and doesn't break other tests.
Cheers :-)
Sure, that was just reflex because I was doing a lot of Golang these days 😄 I'll look at the existing codebase and do the code style accordingly 🙂 and again, thanks for responding really fast.
Hi there,
I'm using this project for my android project. And I wanted to implement a JWT token middleware which will automatically refresh a JWT if it was expired and then continue with the response. Coming across the readme, I found out that beforeSend and afterReceive are planned and are in Todo.
Coming from Golang/TypeScript world, I'd suggest something like this:
Middleware implements an interface with method handle() which receives the original request and the next handler function
Now middleware can choose to either call the next or entirely skip, or maybe even modify the original request before continueing. Let me know if that makes sense 🙂
This one will totally resolve the necessity of the following todos:
Let me know if you'll be willing to accept PRs :)
The text was updated successfully, but these errors were encountered: