TL;DR Is there a way how to react to the unauthori...
# ktor
h
TL;DR Is there a way how to react to the unauthorized response by the Authentication feature, i.e. do something before (automatically) returning the 401 response? Hi, I have deployed my Ktor app to Heroku. When I make a POST request that uploads a file (via multipart/form-data) while the user is not authorized (token has expired), I got the 401 response as intended on my localhost. I use JWT and the Authentication feature. However, the app on Heroku responds with 503 Server Request Interrupted. It only happens when the token is invalid and the 401 should be returned. What I have found so far is that the socket is connected, some data was sent as part of a response, but then the socket was destroyed without completing the response. My question is, is there a way how to react to the unauthorized response by the Authentication feature, i.e. do something before (automatically) returning the 401 response? In my case catching an exception?
n
Have you already tried the status pages plugin? https://ktor.io/docs/status-pages.html
h
Forgot about this option, thank you. It actually resolved my issue :)