io.ktor.server.application.DuplicatePluginException when using an RBAC route
nielsvanharen opened this issue · comments
Niels van Haren commented
whenever i add the rbac functions to a route, i get a DuplicatePluginException, when i check the code, it is trying to install the plugin on every request, why is this and how to solve it?
i.e.
fun Route.withAnyRole(roles: Set<Role>, build: suspend PipelineContext<Unit, ApplicationCall>.() -> Unit) {
install(RoleBasedAuthPlugin) {
any = roles.toSet()
}
handle { build() }
}