diff --git a/rust/core/src/bridge.rs b/rust/core/src/bridge.rs index 5d65a807..bf5ebb43 100644 --- a/rust/core/src/bridge.rs +++ b/rust/core/src/bridge.rs @@ -2631,6 +2631,14 @@ mod tests { ), ("invalid_timestamp", AppError::InvalidTimestamp), ("rp_signature_expired", AppError::RpSignatureExpired), + ( + "identity_attributes_not_matched", + AppError::IdentityAttributesNotMatched, + ), + ( + "identity_attribute_mismatch", + AppError::IdentityAttributesNotMatched, + ), ]; for (code, expected) in cases { diff --git a/rust/core/src/error.rs b/rust/core/src/error.rs index b4dd377e..76f82dcf 100644 --- a/rust/core/src/error.rs +++ b/rust/core/src/error.rs @@ -160,6 +160,8 @@ pub enum AppError { /// Identity attributes did not match the required values #[error("Identity attributes not matched")] + // An early android version using this error code instead of `identity_attributes_not_matched` + #[serde(alias = "identity_attribute_mismatch")] IdentityAttributesNotMatched, /// Generic error @@ -196,7 +198,10 @@ impl AppError { "timestamp_too_far_in_future" => Self::TimestampTooFarInFuture, "invalid_timestamp" => Self::InvalidTimestamp, "rp_signature_expired" => Self::RpSignatureExpired, - "identity_attributes_not_matched" => Self::IdentityAttributesNotMatched, + // An early android version using this error code instead of `identity_attributes_not_matched` + "identity_attributes_not_matched" | "identity_attribute_mismatch" => { + Self::IdentityAttributesNotMatched + } _ => Self::GenericError, } }