From 46403913a4a79ae50afe37af9d82718e977518b8 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 13 Jul 2020 21:47:00 -0700 Subject: [PATCH] logging bad auth requests --- server/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 5072576..0256b6b 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -45,7 +45,7 @@ async fn route_dispatcher(pool: &Pool, resp: &mut Response, meth: &Method, *resp.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; } }, - (&Method::POST, routes::CHANNELS_LIST) => channels::list_channels(pool, resp).await, + (&Method::GET, routes::CHANNELS_LIST) => channels::list_channels(pool, resp).await, (&Method::POST, routes::CHANNELS_CREATE) => channels::create_channel(pool, resp, params).await, (&Method::POST, routes::MESSAGE_SEND) => messages::send_message(pool, resp, params).await, @@ -85,7 +85,10 @@ async fn main_responder(request: Request) -> Result, hyper: // Deal with permissions errors at this point match auth_result { OpenAuth | Good => route_dispatcher(&pool, &mut response, &method, path, params).await, - NoKey => *response.status_mut() = StatusCode::UNAUTHORIZED, + NoKey => { + println!("AUTH: NoKey/BadKey"); + *response.status_mut() = StatusCode::UNAUTHORIZED + }, } } else {