adattato html, test htmx con componente svelte
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user