diff options
Diffstat (limited to 'backend/admin')
| -rw-r--r-- | backend/admin/handler.go | 4 | ||||
| -rw-r--r-- | backend/admin/handler_test.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go index 8eac425..09303ac 100644 --- a/backend/admin/handler.go +++ b/backend/admin/handler.go @@ -14,9 +14,9 @@ import ( "github.com/labstack/echo/v4" "albatross-2026-backend/account" - "albatross-2026-backend/api" "albatross-2026-backend/config" "albatross-2026-backend/db" + "albatross-2026-backend/session" ) var jst = time.FixedZone("Asia/Tokyo", 9*60*60) @@ -39,7 +39,7 @@ func NewHandler(q db.Querier, txm db.TxManager, hub GameHub, conf *config.Config func (h *Handler) newAdminMiddleware() echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { - user, ok := api.GetUserFromContext(c.Request().Context()) + user, ok := session.GetUserFromContext(c.Request().Context()) if !ok { return c.Redirect(http.StatusSeeOther, h.conf.BasePath+"login") } diff --git a/backend/admin/handler_test.go b/backend/admin/handler_test.go index 9de9a0b..20f5775 100644 --- a/backend/admin/handler_test.go +++ b/backend/admin/handler_test.go @@ -14,9 +14,9 @@ import ( "github.com/jackc/pgx/v5/pgtype" "github.com/labstack/echo/v4" - "albatross-2026-backend/api" "albatross-2026-backend/config" "albatross-2026-backend/db" + "albatross-2026-backend/session" ) // mockQuerier implements db.Querier for admin handler testing. @@ -395,7 +395,7 @@ func newEchoContextWithForm(path string, params map[string]string, form url.Valu // --- Admin middleware tests --- func setUserInContext(c echo.Context, user *db.User) { - ctx := api.SetUserInContext(c.Request().Context(), user) + ctx := session.SetUserInContext(c.Request().Context(), user) c.SetRequest(c.Request().WithContext(ctx)) } |
