From f4c17fdff2ecadd9832e32c914285205352eabbc Mon Sep 17 00:00:00 2001 From: tohutohu Date: Sun, 8 Dec 2024 04:25:22 +0900 Subject: [PATCH] =?UTF-8?q?feat(rust):=20=E3=82=A2=E3=82=AF=E3=82=BB?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=82=AF=E3=83=B3=E3=81=8C=E8=AA=A4?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=81=ABUnauthori?= =?UTF-8?q?zed=E3=82=92=E8=BF=94=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/rust/src/middlewares.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/rust/src/middlewares.rs b/webapp/rust/src/middlewares.rs index bd2e5ac2..39759f3a 100644 --- a/webapp/rust/src/middlewares.rs +++ b/webapp/rust/src/middlewares.rs @@ -21,7 +21,7 @@ pub async fn app_auth_middleware( .fetch_optional(&pool) .await? else { - return Err(Error::BadRequest("invalid access token")); + return Err(Error::Unauthorized("invalid access token")); }; req.extensions_mut().insert(user); @@ -44,7 +44,7 @@ pub async fn owner_auth_middleware( .fetch_optional(&pool) .await? else { - return Err(Error::BadRequest("invalid access token")); + return Err(Error::Unauthorized("invalid access token")); }; req.extensions_mut().insert(owner); @@ -67,7 +67,7 @@ pub async fn chair_auth_middleware( .fetch_optional(&pool) .await? else { - return Err(Error::BadRequest("invalid access token")); + return Err(Error::Unauthorized("invalid access token")); }; req.extensions_mut().insert(chair);