feat: Working on route and id helpers for views.
This commit is contained in:
@@ -13,6 +13,7 @@ func routes(_ app: Application) throws {
|
||||
try app.register(collection: VendorViewController())
|
||||
try app.register(collection: EmployeeViewController())
|
||||
try app.register(collection: PurchaseOrderViewController())
|
||||
try app.register(collection: PurchaseOrderSearchViewController())
|
||||
try app.register(collection: UtilsViewController())
|
||||
|
||||
app.get { _ in
|
||||
@@ -56,18 +57,6 @@ func routes(_ app: Application) throws {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let protected = app.grouped(UserPasswordAuthenticator(), UserSessionAuthenticator())
|
||||
|
||||
protected.get("me") { req in
|
||||
let user = try req.auth.require(User.self)
|
||||
|
||||
return HTMLResponse {
|
||||
MainPage(displayNav: false, route: .purchaseOrders) {
|
||||
h1 { "You are logged in as: \(user.username)" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct LoginContext: Content {
|
||||
|
||||
Reference in New Issue
Block a user