fix: update for later version of gotrue

This commit is contained in:
Zack Fu Zi Xiang 2024-08-27 10:15:20 +08:00
parent 44a8bf35c2
commit eb74e095b5
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View File

@ -105,7 +105,7 @@ pub struct GoTrueSettings {
pub mailer_autoconfirm: bool,
pub phone_autoconfirm: bool,
pub sms_provider: String,
pub mfa_enabled: bool,
pub mfa_enabled: Option<bool>, // later version have this field removed
pub saml_enabled: bool,
}

View File

@ -48,9 +48,7 @@ impl Client {
pub async fn settings(&self) -> Result<GoTrueSettings, GoTrueError> {
let url: String = format!("{}/settings", self.base_url);
let resp = self.client.get(&url).send().await?;
let settings: GoTrueSettings = from_response(resp)
.await
.context(format!("calling {} failed", url))?;
let settings: GoTrueSettings = from_response(resp).await?;
Ok(settings)
}