diff --git a/src/account/db.rs b/src/account/db.rs index 26f7fbc..617d3bd 100644 --- a/src/account/db.rs +++ b/src/account/db.rs @@ -5,7 +5,9 @@ use mongodb::{ Client, Collection, Database, }; pub async fn get_db_client() -> Result { - Ok(Client::with_uri_str("mongodb://root:example@localhost:27017").await?) + let username = std::env::var("DB_USERNAME")?; + let password = std::env::var("DB_PASSWORD")?; + Ok(Client::with_uri_str(format!("mongodb://{username}:{password}@localhost:27017")).await?) } pub async fn get_database() -> Result {