From eb94a1bcb92be7e516c5146ae52b7ee4a114e4d2 Mon Sep 17 00:00:00 2001 From: Blitblank Date: Sun, 22 Mar 2026 01:21:50 -0500 Subject: [PATCH] re: require authorization for items list --- api/src/Controllers/ItemsController.cs | 4 ++-- client/src/router/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Controllers/ItemsController.cs b/api/src/Controllers/ItemsController.cs index 65cb0ad..792a475 100644 --- a/api/src/Controllers/ItemsController.cs +++ b/api/src/Controllers/ItemsController.cs @@ -15,13 +15,13 @@ public class ItemsController : ControllerBase { service_ = service; } - [[Authorize]] + [Authorize] [HttpGet] public async Task>> getItems() { return Ok(await service_.GetAll()); } - [[Authorize]] + [Authorize] [HttpGet("{id:int}")] public async Task> getItem(int id) { diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 643be40..8591800 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -13,7 +13,7 @@ const routes = [ { path: "/", component: index }, { path: "/login", component: LoginForm }, { path: "/register", component: RegisterForm }, - { path: "/items", component: ItemsList }, + { path: "/items", component: ItemsList, meta: { requiresAuth: true } }, { path: "/item/new", component: ItemForm, meta: { requiresAuth: true } }, { path: "/item/:id", component: ItemForm, meta: { requiresAuth: true } } ]; // I really like this