Added auth middleware.

This commit is contained in:
mikestefanello 2021-12-12 17:04:11 -05:00
parent 25e5119dd5
commit 9986ca627d
6 changed files with 75 additions and 13 deletions

View file

@ -1,8 +1,6 @@
package controllers
import (
"goweb/auth"
"github.com/labstack/echo/v4"
)
@ -18,8 +16,5 @@ func (h *Home) Get(c echo.Context) error {
p.Metatags.Description = "Welcome to the homepage."
p.Metatags.Keywords = []string{"Go", "MVC", "Web", "Software"}
uid, _ := auth.GetUserID(c)
c.Logger().Infof("logged in user ID: %d", uid)
return h.RenderPage(c, p)
}