spierce7
01/22/2022, 7:12 AMCoroutineContext
that’s used for all requests? I swear there was a way to do this that I read a while ago, but I can’t find it in the documentation.
If I use an Authentication provider, currently that authentication information is only stored inside the call
. I’d like to create a custom CoroutineContext
for each request, so that anywhere in the server that I’m in a suspend
function, I can get the userId, instead of having to pass it through to every method call in my server.spierce7
01/22/2022, 5:23 PMintercept(ApplicationCallPipeline.Call) {
withContext(coroutineContext + MyCoroutineContextElement(call)) {
proceed()
}
}
Rustam Siniukov
01/23/2022, 7:48 PMCall
phase to make context available in routing. Use pipeline.insertPhaseBefore(Call, MyPhase)
for that