I'm updating an plugin for authorization I made for Ktor 1.6 to the new 2.0.0 Plugin concept, but I am running into an issue I don't understand. Say I want plugin
Foo
to run after the existing
Authentication
plugin. When I try
val Foo = createApplicationPlugin("Foo") {
after(Authentication) {
}
}
the line starting with
after
generates a compiler error:
Type mismatch.
Required: io.ktor.server.application.Plugin<*, *, PluginInstance>
Found: io.ktor.server.auth.Authentication.Plugin
The supertype of
io.ktor.server.auth.Authentication.Plugin
is
ApplicationPlugin<Application, Configuration, Authentication>
. Now I am not strong on generics, but I guess this is indeed not a subtype of the required
io.ktor.server.application.Plugin<*, *, PluginInstance>
(Is this the same issue as you talk about
here,
@hhariri?)
Is there any way to make my plugin run after the Authentication plugin?