logging bad auth requests
This commit is contained in:
parent
1eab32889a
commit
46403913a4
@ -45,7 +45,7 @@ async fn route_dispatcher(pool: &Pool, resp: &mut Response<Body>, 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<Body>) -> Result<Response<Body>, 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user