Merge pull request #748 from AppFlowy-IO/gotrue-2.159.0
chore: update gotrue version
This commit is contained in:
commit
612f459a38
|
|
@ -50,10 +50,7 @@ services:
|
|||
|
||||
gotrue:
|
||||
restart: on-failure
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/gotrue.Dockerfile
|
||||
image: appflowyinc/gotrue:${GOTRUE_VERSION:-latest}
|
||||
image: supabase/gotrue:v2.159.1
|
||||
environment:
|
||||
# There are a lot of options to configure GoTrue. You can reference the example config:
|
||||
# https://github.com/supabase/gotrue/blob/master/example.env
|
||||
|
|
|
|||
|
|
@ -45,10 +45,7 @@ services:
|
|||
|
||||
gotrue:
|
||||
restart: on-failure
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/gotrue.Dockerfile
|
||||
image: appflowyinc/gotrue:${GOTRUE_VERSION:-latest}
|
||||
image: supabase/gotrue:v2.159.1
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
|
|
|
|||
|
|
@ -85,15 +85,16 @@ impl Display for GoTrueErrorSerde {
|
|||
/// Used to deserialize the response from the gotrue server
|
||||
#[derive(Serialize, Deserialize, Debug, Error)]
|
||||
pub struct GotrueClientError {
|
||||
pub error: String,
|
||||
pub error: Option<String>,
|
||||
pub error_description: Option<String>,
|
||||
pub msg: Option<String>,
|
||||
}
|
||||
|
||||
impl Display for GotrueClientError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_fmt(format_args!(
|
||||
"error: {}, description: {:?}",
|
||||
self.error, self.error_description
|
||||
"error: {:?}, error_description: {:?}, msg: {:?}",
|
||||
self.error, self.error_description, self.msg
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ async fn sign_in_unknown_user() {
|
|||
let password = "Hello123!";
|
||||
let c = localhost_client();
|
||||
let err = c.sign_in_password(&email, password).await.unwrap_err();
|
||||
assert_eq!(err.code, ErrorCode::OAuthError);
|
||||
assert_eq!(err.code, ErrorCode::OAuthError, "{:?}", err);
|
||||
assert!(!err.message.is_empty());
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ async fn sign_in_wrong_password() {
|
|||
.sign_in_password(&email, wrong_password)
|
||||
.await
|
||||
.unwrap_err();
|
||||
assert_eq!(err.code, ErrorCode::OAuthError);
|
||||
assert_eq!(err.code, ErrorCode::OAuthError, "{:?}", err);
|
||||
assert!(!err.message.is_empty());
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ async fn sign_in_unconfirmed_email() {
|
|||
c.sign_up(&email, password).await.unwrap();
|
||||
|
||||
let err = c.sign_in_password(&email, password).await.unwrap_err();
|
||||
assert_eq!(err.code, ErrorCode::OAuthError);
|
||||
assert_eq!(err.code, ErrorCode::OAuthError, "{:?}", err);
|
||||
assert!(!err.message.is_empty());
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ async fn sign_in_with_invalid_url() {
|
|||
let c = localhost_client();
|
||||
match c.sign_in_with_url(url_str).await {
|
||||
Ok(_) => panic!("should not be ok"),
|
||||
Err(e) => assert_eq!(e.code, ErrorCode::OAuthError),
|
||||
Err(e) => assert_eq!(e.code, ErrorCode::OAuthError, "{:?}", e),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ async fn sign_up_invalid_email() {
|
|||
.sign_up(invalid_email, password)
|
||||
.await
|
||||
.unwrap_err();
|
||||
assert_eq!(error.code, ErrorCode::InvalidRequest);
|
||||
assert_eq!(error.code, ErrorCode::OAuthError);
|
||||
assert_eq!(
|
||||
error.message,
|
||||
"Invalid request:Unable to validate email address: invalid format"
|
||||
"Unable to validate email address: invalid format"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ async fn sign_up_invalid_password() {
|
|||
assert_eq!(error.code, ErrorCode::InvalidRequest);
|
||||
assert_eq!(
|
||||
error.message,
|
||||
"Invalid request:Password should be at least 6 characters"
|
||||
"Invalid request:Password should be at least 6 characters."
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue