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

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