adattato html, test htmx con componente svelte

This commit is contained in:
fabio
2026-02-22 20:23:21 +01:00
parent 0cd6ce05cd
commit 83e85bf899
24 changed files with 3705 additions and 1491 deletions

View File

@@ -19,12 +19,23 @@ func NewAuthController(authService *services.AuthService) *AuthController {
}
func (ac *AuthController) ShowHome(c *fiber.Ctx) error {
if _, ok := httpmw.CurrentUserFromContext(c); ok {
return c.Redirect("/welcome")
}
return renderPublic(c, "home.html", map[string]any{
"Title": "Home",
"NavSection": "public",
})
}
func (ac *AuthController) ShowWelcome(c *fiber.Ctx) error {
return renderPrivate(c, "welcome.html", map[string]any{
"Title": "Welcome",
"NavSection": "private",
})
}
func (ac *AuthController) ShowSignup(c *fiber.Ctx) error {
return renderPublic(c, "signup.html", map[string]any{
"Title": "Sign up",
@@ -90,7 +101,7 @@ func (ac *AuthController) Login(c *fiber.Ctx) error {
if err := httpmw.SetFlashSuccess(c, "Login effettuato"); err != nil {
return err
}
return c.Redirect("/private")
return c.Redirect("/welcome")
}
func (ac *AuthController) Logout(c *fiber.Ctx) error {