recover basic login demo paths
This commit is contained in:
parent
911c1ce734
commit
f5ab92b1cf
2 changed files with 26 additions and 3 deletions
|
|
@ -47,8 +47,27 @@ func WelcomeHome(c *core.Context) *core.Response {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show dashboard
|
|
||||||
func WelcomeToDashboard(c *core.Context) *core.Response {
|
func WelcomeToDashboard(c *core.Context) *core.Response {
|
||||||
message := "{\"message\": \"Welcome to Dashboard\"}"
|
message := "{\"message\": \"Welcome to Dashboard\"}"
|
||||||
return c.Response.Json(message)
|
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)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"git.smarteching.com/goffee/core"
|
"git.smarteching.com/goffee/core"
|
||||||
"git.smarteching.com/goffee/cup/controllers"
|
"git.smarteching.com/goffee/cup/controllers"
|
||||||
|
"git.smarteching.com/goffee/cup/hooks"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Register the app controllers
|
// Register the app controllers
|
||||||
|
|
@ -19,7 +20,7 @@ func registerRoutes() {
|
||||||
|
|
||||||
// Define your routes here...
|
// Define your routes here...
|
||||||
controller.Get("/", controllers.WelcomeHome)
|
controller.Get("/", controllers.WelcomeHome)
|
||||||
|
|
||||||
// Uncomment the lines below to enable authentication API
|
// Uncomment the lines below to enable authentication API
|
||||||
controller.Post("/signup", controllers.Signup)
|
controller.Post("/signup", controllers.Signup)
|
||||||
controller.Post("/signin", controllers.Signin)
|
controller.Post("/signin", controllers.Signin)
|
||||||
|
|
@ -37,5 +38,8 @@ func registerRoutes() {
|
||||||
controller.Post("/admin/users/delete", controllers.AdminUsersDelete)
|
controller.Post("/admin/users/delete", controllers.AdminUsersDelete)
|
||||||
controller.Post("/admin/users/deleteconfirm", controllers.AdminUsersDelConfirm)
|
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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue