Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3387305
D11430.id38412.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11430.id38412.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11430: [native_rust_library] unlink_farcaster_account method
Attached
Detach File
Event Timeline
Log In to Comment