AdrianTodt
09/23/2018, 9:13 PMget("/") { _ ->
val session = call.sessions.get<DashSession>() ?: return@get call.respondRedirect("/login")
/* code */
}
Deactivated User
09/24/2018, 7:42 AMinline fun <reified T> CurrentSession.getOrThrow(): T =
this.get<T>() ?: throw SessionNotFoundException(T::class)
https://github.com/ktorio/ktor-samples/blob/379b2e83146ed6ca9ad42bcc77bc2f346508bd1a/other/redirect-with-exception/src/RedirectWithExceptionApplication.kt