Move admin pages to primary layout.

This commit is contained in:
mikestefanello 2025-04-19 16:19:58 -04:00
parent 2c9cf2a21a
commit db09b1db97
4 changed files with 28 additions and 75 deletions

View file

@ -28,6 +28,9 @@ type (
// IsAuth stores whether the user is authenticated.
IsAuth bool
// IsAdmin stores whether the user is an admin.
IsAdmin bool
// AuthUser stores the authenticated user.
AuthUser *ent.User
@ -77,6 +80,7 @@ func NewRequest(ctx echo.Context) *Request {
if u := ctx.Get(context.AuthenticatedUserKey); u != nil {
p.IsAuth = true
p.AuthUser = u.(*ent.User)
p.IsAdmin = p.AuthUser.Admin
}
if cfg := ctx.Get(context.ConfigKey); cfg != nil {