pub async fn request_credentials(&mut self) -> color_eyre::Result<()> {
        let mut name = String::new();
        let mut key;
        loop {
            name = utils::user_input(
                "Hypothesis username",
                if name.is_empty() { None } else { Some(&name) },
                true,
                false,
            )?;
            key = dialoguer::Password::with_theme(&dialoguer::theme::ColorfulTheme::default())
                .with_prompt("Hypothesis developer API key")
                .interact()?;
            if Self::authorize(&name, &key).await? {
                self.hypothesis_username = Some(name);
                self.hypothesis_key = Some(key);
                self.store()?;
                return Ok(());
            } else {
                println!("Could not authorize your Hypothesis credentials, please try again.");
            }
        }
    }
/// Asks user for Hypothesis credentials and sets them in the config
Asks user for Hypothesis credentials and sets them in the config
Asks user for Hypothesis credentials and sets them in the config
pub async fn request_credentials(&mut self) -> color_eyre::Result<()> {
        let mut name = String::new();
        let mut key;
        loop {
            name = utils::user_input(
                "Hypothesis username",
                if name.is_empty() { None } else { Some(&name) },
                true,
                false,
            )?;
            key = dialoguer::Password::with_theme(&dialoguer::theme::ColorfulTheme::default())
                .with_prompt("Hypothesis developer API key")
                .interact()?;
            if Self::authorize(&name, &key).await? {
                self.hypothesis_username = Some(name);
                self.hypothesis_key = Some(key);
                self.store()?;
                return Ok(());
            } else {
                println!("Could not authorize your Hypothesis credentials, please try again.");
            }
        }
    }
pub async fn request_credentials ( & mut self ) -> color_eyre :: Result < ( ) > { let mut name = String :: new ( ) ; let mut key ; loop { name = utils :: user_input ( " " , if name . is_empty ( ) { None } else { Some ( & name ) } , true , false , ) ? ; key = dialoguer :: Password :: with_theme ( & dialoguer :: theme :: ColorfulTheme :: default ( ) ) . with_prompt ( " " ) . interact ( ) ? ; if Self :: authorize ( & name , & key ) . await ? { self . hypothesis_username = Some ( name ) ; self . hypothesis_key = Some ( key ) ; self . store ( ) ? ; return Ok ( ( ) ) ; } else { println ! ( " " ) ; } } }
Asks user for Hypothesis credentials and sets them in the config
Asks user for Hypothesis credentials and sets them in the config
&mut self
&mut self