Page MenuHomePhabricator

D12584.diff
No OneTemporary

D12584.diff

diff --git a/native/native_rust_library/src/identity/account_actions.rs b/native/native_rust_library/src/identity/account_actions.rs
--- a/native/native_rust_library/src/identity/account_actions.rs
+++ b/native/native_rust_library/src/identity/account_actions.rs
@@ -2,7 +2,8 @@
use grpc_clients::identity::get_auth_client;
use grpc_clients::identity::protos::auth::{
DeletePasswordUserFinishRequest, DeletePasswordUserStartRequest,
- UpdateUserPasswordFinishRequest, UpdateUserPasswordStartRequest,
+ PrimaryDeviceLogoutRequest, UpdateUserPasswordFinishRequest,
+ UpdateUserPasswordStartRequest,
};
use grpc_clients::identity::protos::unauth::Empty;
@@ -88,6 +89,28 @@
});
}
+ pub fn log_out_primary_device(
+ user_id: String,
+ device_id: String,
+ access_token: String,
+ signed_device_list: String,
+ promise_id: u32,
+ ) {
+ RUNTIME.spawn(async move {
+ let auth_info = AuthInfo {
+ access_token,
+ user_id,
+ device_id,
+ };
+ let result = log_out_helper(
+ auth_info,
+ LogOutType::PrimaryDevice { signed_device_list },
+ )
+ .await;
+ handle_void_result_as_callback(result, promise_id);
+ });
+ }
+
pub fn log_out_secondary_device(
user_id: String,
device_id: String,
@@ -229,6 +252,7 @@
enum LogOutType {
Legacy,
+ PrimaryDevice { signed_device_list: String },
SecondaryDevice,
}
@@ -250,6 +274,10 @@
LogOutType::SecondaryDevice => {
identity_client.log_out_secondary_device(Empty {}).await?
}
+ LogOutType::PrimaryDevice { signed_device_list } => {
+ let request = PrimaryDeviceLogoutRequest { signed_device_list };
+ identity_client.log_out_primary_device(request).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
@@ -160,6 +160,15 @@
promise_id: u32,
);
+ #[cxx_name = "identityLogOutPrimaryDevice"]
+ fn log_out_primary_device(
+ user_id: String,
+ device_id: String,
+ access_token: String,
+ signed_device_list: String,
+ promise_id: u32,
+ );
+
#[cxx_name = "identityLogOutSecondaryDevice"]
fn log_out_secondary_device(
user_id: String,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 11:54 PM (12 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566711
Default Alt Text
D12584.diff (2 KB)

Event Timeline