pub fn hash_password(password: &str) -> Result<String, ServiceError> {
    let secret_key = get_service_config_value("user_management", "password-key", true)?;
    let result = Hasher::default()
        .with_password(password)
        .with_secret_key(secret_key.as_str())
        .hash();

    match result {
        Ok(hash) => Ok(hash),
        Err(err) => Err(ServiceError::InternalServerError(format!("Password hash error {:?}", err.to_string()))),
    }
}
/// Takes in a password and returns a Hash
Takes in a password and returns a Hash
Takes in a password and returns a Hash
pub fn hash_password(password: &str) -> Result<String, ServiceError> {
    let secret_key = get_service_config_value("user_management", "password-key", true)?;
    let result = Hasher::default()
        .with_password(password)
        .with_secret_key(secret_key.as_str())
        .hash();
    match result {
        Ok(hash) => Ok(hash),
        Err(err) => Err(ServiceError::InternalServerError(format!("Password hash error {:?}", err.to_string()))),
    }
}
pub fn hash_password ( password : & str ) -> Result < String , ServiceError > { let secret_key = get_service_config_value ( " " , " " , true ) ? ; let result = Hasher :: default ( ) . with_password ( password ) . with_secret_key ( secret_key . as_str ( ) ) . hash ( ) ; match result { Ok ( hash ) => Ok ( hash ) , Err ( err ) => Err ( ServiceError :: InternalServerError ( format ! ( " " err to_string ( ) ) ) ) , } }
Takes in a password and returns a Hash
Takes in a password and returns a Hash
password
&str