shamsher_auth_service/lib.rs
1#![allow(dead_code, unused_variables)]
2use rand::prelude::*;
3mod database;
4mod shamsher_auth_utils;
5// that use declation bring to scope
6pub use shamsher_auth_utils::models::Credentials;
7pub fn authenticate(creds: Credentials) {
8 let timeout = thread_rng().gen_range(100..500);
9 println!("time out is {}", timeout);
10 if let database::Status::Connected = database::connect_to_database() {
11 shamsher_auth_utils::login(creds)
12 }
13}