octylFractal
09/23/2018, 9:40 PMApplicationCall
and use that:
fun ApplicationCall.requireSession(): DashSession? {
val session = sessions.get<DashSession>()
if (session == null) respondRedirect("/login")
return session
}
use it like this:
val session = call.requireSession() ?: return@get
Deactivated User
09/24/2018, 7:58 AMStatusPages
and exceptions here:
https://github.com/ktorio/ktor-samples/blob/379b2e83146ed6ca9ad42bcc77bc2f346508bd1a/other/redirect-with-exception/src/RedirectWithExceptionApplication.kt