feat: Adds route query parameter to home, htmx updates url, and working next parameter for login

This commit is contained in:
2025-01-07 20:39:12 -05:00
parent 6eb723a7cf
commit e86e5facc6
5 changed files with 61 additions and 30 deletions

View File

@@ -5,6 +5,11 @@ extension RoutesBuilder {
// Used to ensure views are protected, redirects users to the login page if they're
// not authenticated.
var protected: any RoutesBuilder {
grouped(User.credentialsAuthenticator(), User.redirectMiddleware(path: "login"))
grouped(
User.credentialsAuthenticator(),
User.redirectMiddleware { req in
"login?next=\(req.url)"
}
)
}
}