Page MenuHomePhabricator

D11430.id38412.diff
No OneTemporary

D11430.id38412.diff

diff --git a/native/native_rust_library/src/farcaster.rs b/native/native_rust_library/src/farcaster.rs
--- a/native/native_rust_library/src/farcaster.rs
+++ b/native/native_rust_library/src/farcaster.rs
@@ -4,7 +4,7 @@
};
use grpc_clients::identity::{
get_auth_client, get_unauthenticated_client,
- protos::auth::LinkFarcasterAccountRequest,
+ protos::auth::LinkFarcasterAccountRequest, protos::unauth::Empty,
protos::unauth::GetFarcasterUsersRequest,
};
use serde::Serialize;
@@ -108,3 +108,36 @@
Ok(())
}
+
+pub fn unlink_farcaster_account(
+ user_id: String,
+ device_id: String,
+ access_token: String,
+ promise_id: u32,
+) {
+ RUNTIME.spawn(async move {
+ let result =
+ unlink_farcaster_account_helper(user_id, device_id, access_token).await;
+ handle_void_result_as_callback(result, promise_id);
+ });
+}
+
+async fn unlink_farcaster_account_helper(
+ user_id: String,
+ device_id: String,
+ access_token: String,
+) -> Result<(), Error> {
+ let mut identity_client = get_auth_client(
+ IDENTITY_SOCKET_ADDR,
+ user_id,
+ device_id,
+ access_token,
+ CODE_VERSION,
+ DEVICE_TYPE.as_str_name().to_lowercase(),
+ )
+ .await?;
+
+ identity_client.unlink_farcaster_account(Empty {}).await?;
+
+ Ok(())
+}
diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs
--- a/native/native_rust_library/src/lib.rs
+++ b/native/native_rust_library/src/lib.rs
@@ -6,6 +6,7 @@
};
use farcaster::{
farcaster_id_string_to_option, get_farcaster_users, link_farcaster_account,
+ unlink_farcaster_account,
};
use ffi::{bool_callback, string_callback, void_callback};
use future_manager::ffi::*;
@@ -258,6 +259,14 @@
promise_id: u32,
);
+ #[cxx_name = "identityUnlinkFarcasterAccount"]
+ fn unlink_farcaster_account(
+ user_id: String,
+ device_id: String,
+ access_token: String,
+ promise_id: u32,
+ );
+
// Argon2
#[cxx_name = "compute_backup_key"]
fn compute_backup_key_str(

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 8:48 AM (19 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2600311
Default Alt Text
D11430.id38412.diff (1 KB)

Event Timeline