Added auth to the container.
This commit is contained in:
parent
c9d50cb3d4
commit
a33a76f8bc
9 changed files with 81 additions and 32 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue