ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort
https://ktor.io
Apache License 2.0
12.72k stars 1.04k forks source link

is there any way to custom handle authentication fail #921

Closed LeonDevLifeLog closed 5 years ago

LeonDevLifeLog commented 5 years ago

Ktor Version

1.1.2

Ktor Engine Used(client or server and name)

server: netty

JVM Version, Operating System and Relevant Context

jvm: 1.8 OS: windows 10

Feedback

Default response of authentication fail is 401 status and empty body,and now i want set some message on response body. I has been read doc and source code,but not find any method to do this. may be this issue #366 is related

Ktor is a awesome framework! thanks developers!

LeonDevLifeLog commented 5 years ago

I has changed my mind,and from another way to salved this problem. I used the "StatusPages" feature . :smiley: thanks lot