Emanuele Iannuzzi
03/16/2025, 5:44 PMfun Application.privateRoutes() {
routing {
authenticate("auth-oauth-google") {
applicationAuthRoutes()
get("works-fine") {
// Actually redirects to google oauth flow
}
}
}
}
fun Routing.applicationAuthRoutes() {
route("/auth") {
authLogin()
authCallback()
}
}
fun Route.authLogin() {
get("/login") {
// Redirection to Google OAuth Flow should happen automatically, but for some reason this route is not behind authentication
}
}
fun Route.authCallback() {
get("/callback") {
// This route neither
}
}
Chrimaeon
03/16/2025, 6:33 PM/
that is not part of your works-fine
Emanuele Iannuzzi
03/16/2025, 6:56 PMChrimaeon
03/16/2025, 7:17 PMEmanuele Iannuzzi
03/16/2025, 7:18 PMmadisp
03/17/2025, 7:31 AMauthenticate
takes a build: Route.() -> Unit
lambda as a configuration, not a build: Routing.() -> Unit
(like routing
does)madisp
03/17/2025, 7:32 AMRouting.applicationAuthRoutes()
extension method ends up being invoked on the root routing
object, not in the authentication scopeAleksei Tirman [JB]
03/17/2025, 9:36 AMEmanuele Iannuzzi
03/17/2025, 9:03 PM