Hello, with Ktor Client i want to archive secure h...
# coroutines
s
Hello, with Ktor Client i want to archive secure http requests. The idea is: 1. make a request 2. response code equals to 401 3. stop all other request and make them wait for response from auth endpoint (ex: refresh token) 4. receive new token 5. rerun request from 1 step and resume all “pending” request from step 3. I think I can archive it with
ConflatedBroadcastChannel
, but i dont know how to do it. Pls share with your thoughts
d
What do you mean by, stopping a request?
l
They probably mean cancel and retry after refresh, under the hood.
s
Yes, stop and retry after token is refreshed