recover basic login demo paths

This commit is contained in:
Zeni Kim 2026-05-16 10:55:02 -05:00
parent 911c1ce734
commit f5ab92b1cf
2 changed files with 26 additions and 3 deletions

View file

@ -47,8 +47,27 @@ func WelcomeHome(c *core.Context) *core.Response {
}
// Show dashboard
func WelcomeToDashboard(c *core.Context) *core.Response {
message := "{\"message\": \"Welcome to Dashboard\"}"
return c.Response.Json(message)
}
// Show basic app login
func AppLogin(c *core.Context) *core.Response {
// first, include all compoments
// first, include all compoments
type templateData struct {
PageCard components.PageCard
}
// now fill data of the components
tmplData := templateData{
PageCard: components.PageCard{
CardTitle: "Card title",
CardBody: "Loerm ipsum at deim",
},
}
return c.Response.Template("login.html", tmplData)
}

View file

@ -8,6 +8,7 @@ package main
import (
"git.smarteching.com/goffee/core"
"git.smarteching.com/goffee/cup/controllers"
"git.smarteching.com/goffee/cup/hooks"
)
// Register the app controllers
@ -37,5 +38,8 @@ func registerRoutes() {
controller.Post("/admin/users/delete", controllers.AdminUsersDelete)
controller.Post("/admin/users/deleteconfirm", controllers.AdminUsersDelConfirm)
controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)
controller.Get("/signout", controllers.Signout)
controller.Get("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
controller.Post("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
}