fn confirm_secret(job_secret: &str) -> Option<String> {
    let secret = Password::new()
        .with_prompt("Please provide your encryption secret")
        .interact()
        .expect("[ERR] failed to create encryption secret prompt.");
    let term = |e: argon2::Error| {
        terminate!(
            5,
            "{} failed to compare job secret with provided secret: {}.",
            "[ERR]".red(),
            e
        );
    };
    if !compare_argon_secret(&secret, job_secret).unwrap_or_else(term) {
        terminate!(1, "{} incorrect secret.", "[ERR]".red());
    };
    Some(secret)
}
// Confirm correct secret from user input
Confirm correct secret from user input
Confirm correct secret from user input
fn confirm_secret(job_secret: &str) -> Option<String> {
    let secret = Password::new()
        .with_prompt("Please provide your encryption secret")
        .interact()
        .expect("[ERR] failed to create encryption secret prompt.");
    let term = |e: argon2::Error| {
        terminate!(
            5,
            "{} failed to compare job secret with provided secret: {}.",
            "[ERR]".red(),
            e
        );
    };
    if !compare_argon_secret(&secret, job_secret).unwrap_or_else(term) {
        terminate!(1, "{} incorrect secret.", "[ERR]".red());
    };
    Some(secret)
}
fn confirm_secret ( job_secret : & str ) -> Option < String > { let secret = Password :: new ( ) . with_prompt ( " " ) . interact ( ) . expect ( " " ) ; let term = | e : argon2 :: Error | { terminate ! ( 5 " " " " red ( ) e ) ; } ; if ! compare_argon_secret ( & secret , job_secret ) . unwrap_or_else ( term ) { terminate ! ( 1 " " " " red ( ) ) ; } ; Some ( secret ) }
Confirm correct secret from user input
Confirm correct secret from user input
job_secret
&str
job_secret
&str