Login / logout

This commit is contained in:
Eden Kirin
2024-02-06 15:39:55 +01:00
parent 8ecfeb71e6
commit 75cded4054
12 changed files with 239 additions and 112 deletions

View File

@ -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
}