use rand::{prelude::*, thread_rng};
pub use auth_utils::{login, models::Credentials};
use database::Status;
pub fn authenticate(creds: &mut Credentials) {
let timeout = thread_rng().gen_range(100..500);
println!("Simulating authentication delay:{timeout}");
if let Status::Connected = database::connect_to_database() {
println!("Connected to the database");
login(creds);
} else {
println!("Failed to connect to the database");
}
}
mod database;
pub mod auth_utils;