external_dependencies 0.1.0

Example auth services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use rand::{prelude::*, rng};

mod database;
mod auth_utils;

pub use auth_utils::models::Credentials;
use database::Status;

pub fn authenticate(creds: Credentials) {
    let timeout = rng().random_range(100..500);
    println!("Timeout: {}", timeout);
    if let Status::Connected = database::connect_to_database() {
        auth_utils::login(creds);
    }
}