Hi all, I'm hoping there's a way to do this, but is there any way to authenticate all routes in an application without wrapping authenticate everywhere? We have an application that's structuring the routes
routing {
someRoute1()
someRoute2()
...
someRoute100()
}
with each group of routes in it's own file
fun Application.someRoute1() {
routing {
route('/some/{place}') {
head {
}
get {
}
}
}
}
however, we now want to add authentication to all routes, but if we add the authenticate function to the first example,
routing {
authenticate {
someRoute1()
someRoute2()
...
someRoute100()
}
}
it doesn't seem like the individual route functions get the authenticate function. Is there a way to do this without manually editing each individual route file?