diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -403,6 +403,17 @@ .map_err(|e| Error::AwsSdk(e.into())) } + pub async fn username_available( + &self, + username: String, + ) -> Result { + let result = self + .get_user_id_from_user_info(username, AuthType::Password) + .await?; + + Ok(result.is_none()) + } + pub async fn get_user_id_from_user_info( &self, user_info: String,