Peter
04/27/2022, 5:27 PMAuthentication.ChallengePhase
?internal object ChallengeHook : Hook<suspend (ApplicationCall) -> Unit> {
internal val ChallengePhase: PipelinePhase = PipelinePhase("Challenge")
but it's internal
😞Ron S
04/27/2022, 5:32 PMPeter
04/27/2022, 5:33 PMPipelinePhase
isn't a data class either... so assuming just redeclaring an instance won't compare equally the internal one?Ron S
04/27/2022, 5:53 PMPipelinePhase("Challenge")
creating my own instance of it might actually work, but I have no idea how to test it. the interceptor triggers and there is no excption being thrownAleksei Tirman [JB]
04/28/2022, 1:31 AMRustam Siniukov
04/28/2022, 8:02 AMAuthenticationChecked
hookRon S
04/28/2022, 8:47 AMfun Route.authorization(build: Route.() -> Unit): Route {
val route = createChild(CustomSelector())
val plugin = createRouteScopedPlugin("CustomAuthorization") {
on(AuthenticationChecked) { call ->
val principal = call.authentication.principal
// custom logic
}
}
route.install(plugin)
route.build()
return route
}
Peter
04/28/2022, 2:21 PM