async fn pretend_password_processing() -> Error {
    static PROCESSING_TIME: Lazy<std::time::Duration> = Lazy::new(|| {
        let hashed_pw = bcrypt::hash("badpassword", BCRYPT_COST).expect("could not hash pw");
        let start = std::time::Instant::now();
        let _ = bcrypt::verify("abcdefg", &hashed_pw);
        let end = std::time::Instant::now();
        end - start
    });
    println!("pretending to process password - should be an invalid email");
    tokio::time::sleep(*PROCESSING_TIME).await;
    Error::WrongCredentialsError
}
/// This exists to pretend that a password is being processed in the cases where it's not. This
/// makes it harder to guess if a malicious request got an existing email with non-matching
/// password vs. an email that does not exist.
///
/// There is currently a bug: on the first time this function is called, the delay is a lot longer
/// than on every other call. A workaround is to call this function at some point during
/// initialization. I'm too `Lazy` to fix it, so it's called in `init_default_users` to do the
/// workaround.
This exists to pretend that a password is being processed in the cases where it's not. This
makes it harder to guess if a malicious request got an existing email with non-matching
password vs. an email that does not exist.

There is currently a bug: on the first time this function is called, the delay is a lot longer
than on every other call. A workaround is to call this function at some point during
initialization. I'm too `Lazy` to fix it, so it's called in `init_default_users` to do the
workaround.
This exists to pretend that a password is being processed in the cases where it ' s not . This makes it harder to guess if a malicious request got an existing email with non - matching password vs . an email that does not exist . There is currently a bug : on the first time this function is called the delay is a lot longer than on every other call . A workaround is to call this function at some point during initialization . I ' m too ` Lazy ` to fix it so it ' s called in ` init_default_users ` to do the workaround .
async fn pretend_password_processing() -> Error {
    static PROCESSING_TIME: Lazy<std::time::Duration> = Lazy::new(|| {
        let hashed_pw = bcrypt::hash("badpassword", BCRYPT_COST).expect("could not hash pw");
        let start = std::time::Instant::now();
        let _ = bcrypt::verify("abcdefg", &hashed_pw);
        let end = std::time::Instant::now();
        end - start
    });
    println!("pretending to process password - should be an invalid email");
    tokio::time::sleep(*PROCESSING_TIME).await;
    Error::WrongCredentialsError
}
async fn pretend_password_processing ( ) -> Error { static PROCESSING_TIME : Lazy < std :: time :: Duration > = Lazy :: new ( | | { let hashed_pw = bcrypt :: hash ( " " , BCRYPT_COST ) . expect ( " " ) ; let start = std :: time :: Instant :: now ( ) ; let _ = bcrypt :: verify ( " " , & hashed_pw ) ; let end = std :: time :: Instant :: now ( ) ; end - start } ) ; println ! ( " " ) ; tokio :: time :: sleep ( * PROCESSING_TIME ) . await ; Error :: WrongCredentialsError }
This exists to pretend that a password is being processed in the cases where it's not.
This exists to pretend that a password is being processed in the cases where it ' s not .