I have read <https://ktor.io/advanced/pipeline.htm...
# ktor
m
I have read https://ktor.io/advanced/pipeline.html but I am still a bit lost when it comes to how to control exactly when a Feature is run. I have a feature that should be run after authentication (I want to check if a principal is present) but before it is too late to make a
call.respond(...)
. It seems that whenever I insert my feature to a
PipelinePhase
it is either too early for the principal to have been processed (I can see for example that the
Authorization
header is present, but
principal
is null because it has not been set yet) or to late to make a response to the request. How do I solve this (in a good manner)?
Never mind. I got it to work by intercepting everything in the sendPipeline.