diff --git a/crates/backend/src/db/group.rs b/crates/backend/src/db/group.rs index 83983bf..c6169ce 100644 --- a/crates/backend/src/db/group.rs +++ b/crates/backend/src/db/group.rs @@ -1,7 +1,11 @@ use super::Database; impl Database { - async fn add_user_to_group(&self) {} + async fn add_user_to_group(&self) { + todo!("Implement add_user_to_group method"); + } - async fn create_group(&self) {} + async fn create_group(&self) { + todo!("Implement create_group method"); + } } diff --git a/crates/backend/src/db/user.rs b/crates/backend/src/db/user.rs index 12b1d7f..4e5cf28 100644 --- a/crates/backend/src/db/user.rs +++ b/crates/backend/src/db/user.rs @@ -94,7 +94,10 @@ impl Database { let password_hash = PasswordHash::new(&local_auth.hash) .map_err(|err| ApiError::Argon2Error(err.to_string()))?; - if let Err(_) = argon2.verify_password(password.as_bytes(), &password_hash) { + if argon2 + .verify_password(password.as_bytes(), &password_hash) + .is_err() + { return Err(ApiError::Unauthorized); } diff --git a/crates/backend/src/error.rs b/crates/backend/src/error.rs index fde5316..50f0872 100644 --- a/crates/backend/src/error.rs +++ b/crates/backend/src/error.rs @@ -34,7 +34,7 @@ impl ResponseError for ApiError { ApiError::ValidationError(..) => StatusCode::BAD_REQUEST, ApiError::Argon2Error(..) => StatusCode::INTERNAL_SERVER_ERROR, ApiError::SessionInsertError(..) => StatusCode::INTERNAL_SERVER_ERROR, - ApiError::AlreadyLoggedIn => StatusCode::BAD_REQUEST, + ApiError::AlreadyLoggedIn => StatusCode::CONFLICT, } } diff --git a/crates/backend/src/main.rs b/crates/backend/src/main.rs index fb7a662..35a9290 100644 --- a/crates/backend/src/main.rs +++ b/crates/backend/src/main.rs @@ -120,11 +120,10 @@ async fn connect_to_redis_database() -> RedisSessionStore { .map(|x| x.parse::().expect("REDIS_PORT is not a valid port")) .unwrap_or(6379); let redis_connection_string = format!("redis://{}:{}", redis_host, redis_port); - let store = RedisSessionStore::new(redis_connection_string) - .await - .unwrap(); - store + RedisSessionStore::new(redis_connection_string) + .await + .unwrap() } fn build_database_url() -> String {