// ensure fitbit is fully setup by
// * refreshing token
// * setting up subscription
ensure fitbit is fully setup by
refreshing token
setting up subscription
ensure fitbit is fully setup by refreshing token setting up subscription
pub(crate) async fn fitbit_ensure_setup(&self) -> Result<()> {
        let mut user = self.ensure_user().await?;
        loop {
            match user.validate_fitbit().await? {
                FitbitState::NoAuth => {
                    // do auth refresh
                    user.refresh_oauth_token(self).await?;
                }
                FitbitState::AuthNoSub => {
                    // do sub
                    user.setup_subscription().await?;
                }
                FitbitState::Ok => {
                    // ok
                    return Ok(());
                }
            }
        }
    }
pub ( crate ) async fn fitbit_ensure_setup ( & self ) -> Result < ( ) > { let mut user = self . ensure_user ( ) . await ? ; loop { match user . validate_fitbit ( ) . await ? { FitbitState :: NoAuth => { // do auth refresh user . refresh_oauth_token ( self ) . await ? ; } FitbitState :: AuthNoSub => { // do sub user . setup_subscription ( ) . await ? ; } FitbitState :: Ok => { // ok return Ok ( ( ) ) ; } } } }
ensure fitbit is fully setup by
 refreshing token
 setting up subscription
ensure fitbit is fully setup by refreshing token setting up subscription
&self