Minor changes

This commit is contained in:
Andras Schmelczer 2025-03-25 22:26:57 +00:00
parent ed54a2391b
commit b48af7e211
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 5 additions and 9 deletions

View file

@ -1,7 +1,7 @@
mod app_state;
mod cli;
mod config;
mod consts;
mod database;
mod errors;
mod server;
mod utils;
@ -20,13 +20,8 @@ async fn main() -> Result<(), SyncServerError> {
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| {
format!(
"{}=debug,tower_http=debug,axum::rejection=trace",
env!("CARGO_CRATE_NAME")
)
.into()
}),
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| format!("{}=debug", env!("CARGO_CRATE_NAME")).into()),
)
.with(tracing_subscriber::fmt::layer())
.try_init()

View file

@ -1,9 +1,10 @@
use super::app_state::AppState;
use crate::{
app_state::AppState,
config::user_config::User,
errors::{SyncServerError, unauthorized_error},
};
// TODO: turn this into a middleware
pub fn auth(app_state: &AppState, token: &str) -> Result<User, SyncServerError> {
app_state
.config