Added auth to the container.

This commit is contained in:
mikestefanello 2021-12-15 09:29:43 -05:00
parent c9d50cb3d4
commit a33a76f8bc
9 changed files with 81 additions and 32 deletions

View file

@ -5,7 +5,7 @@ import (
"net/http"
"time"
"goweb/auth"
"goweb/context"
"goweb/msg"
"goweb/pager"
@ -62,7 +62,7 @@ func NewPage(c echo.Context) Page {
p.CSRF = csrf.(string)
}
if _, err := auth.GetUserID(c); err == nil {
if u := c.Get(context.AuthenticatedUserKey); u != nil {
p.IsAuth = true
}