Minor changes

This commit is contained in:
Andras Schmelczer 2025-03-25 22:26:57 +00:00
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 cli;
mod config; mod config;
mod consts; mod consts;
mod database;
mod errors; mod errors;
mod server; mod server;
mod utils; mod utils;
@ -20,13 +20,8 @@ async fn main() -> Result<(), SyncServerError> {
tracing_subscriber::registry() tracing_subscriber::registry()
.with( .with(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| { tracing_subscriber::EnvFilter::try_from_default_env()
format!( .unwrap_or_else(|_| format!("{}=debug", env!("CARGO_CRATE_NAME")).into()),
"{}=debug,tower_http=debug,axum::rejection=trace",
env!("CARGO_CRATE_NAME")
)
.into()
}),
) )
.with(tracing_subscriber::fmt::layer()) .with(tracing_subscriber::fmt::layer())
.try_init() .try_init()

View file

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