Login / logout
This commit is contained in:
@ -1,23 +1,20 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fiber-sessions/app/handlers/usersession"
|
||||
"fiber-sessions/app/templates"
|
||||
"fiber-sessions/app/types"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Home(f *fiber.Ctx) error {
|
||||
user := types.User{
|
||||
FirstName: "Pero",
|
||||
LastName: "Perić",
|
||||
}
|
||||
func Home(ctx *fiber.Ctx) error {
|
||||
requestSession := usersession.NewRequestSession(ctx)
|
||||
|
||||
pc := templates.PageContext{
|
||||
Title: "Welcome to the demo",
|
||||
ActivePage: "home",
|
||||
User: &user,
|
||||
Title: "Welcome to the demo",
|
||||
ActivePage: "home",
|
||||
RequestSession: requestSession,
|
||||
}
|
||||
Render(f, templates.Home(pc))
|
||||
Render(ctx, templates.Home(pc))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user