diff --git a/extensions/warp-ipfs/src/store/document/cache.rs b/extensions/warp-ipfs/src/store/document/cache.rs index a6e6867c9..e71fa5a2f 100644 --- a/extensions/warp-ipfs/src/store/document/cache.rs +++ b/extensions/warp-ipfs/src/store/document/cache.rs @@ -169,8 +169,7 @@ impl IdentityCacheTask { match old_document { Some(old_document) => { if !old_document.different(&document) { - tracing::error!("Identity in cache havent changed"); - let _ = response.send(Err(Error::IdentityExist)); + let _ = response.send(Ok(None)); continue; } diff --git a/extensions/warp-ipfs/src/store/document/identity.rs b/extensions/warp-ipfs/src/store/document/identity.rs index 0e74d1d08..5951192dd 100644 --- a/extensions/warp-ipfs/src/store/document/identity.rs +++ b/extensions/warp-ipfs/src/store/document/identity.rs @@ -107,17 +107,20 @@ impl IdentityDocument { return false; } - if self.username != other.username + if other.verify().is_err() { + tracing::warn!( + "identity for {} is not valid, corrupted or been tampered with.", + self.did + ); + return false; + } + + self.username != other.username || self.status_message != other.status_message || self.status != other.status || self.profile_banner != other.profile_banner || self.profile_picture != other.profile_picture || self.platform != other.platform - { - return other.verify().is_ok(); - } - - false } }