Page MenuHomePhabricator

D12122.id40681.diff
No OneTemporary

D12122.id40681.diff

diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js
--- a/lib/types/identity-service-types.js
+++ b/lib/types/identity-service-types.js
@@ -123,6 +123,7 @@
// primary device
+deletePasswordUser?: (password: string) => Promise<void>;
+logOut: () => Promise<void>;
+ +logOutSecondaryDevice: () => Promise<void>;
+getKeyserverKeys: string => Promise<DeviceOlmOutboundKeys>;
// Users cannot register from web
+registerPasswordUser?: (
diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js
--- a/native/identity-service/identity-service-context-provider.react.js
+++ b/native/identity-service/identity-service-context-provider.react.js
@@ -132,6 +132,14 @@
} = await getAuthMetadata();
return commRustModule.logOut(userID, deviceID, token);
},
+ logOutSecondaryDevice: async () => {
+ const {
+ deviceID,
+ userID,
+ accessToken: token,
+ } = await getAuthMetadata();
+ return commRustModule.logOutSecondaryDevice(userID, deviceID, token);
+ },
getKeyserverKeys: async (
keyserverID: string,
): Promise<DeviceOlmOutboundKeys> => {
diff --git a/web/grpc/identity-service-client-wrapper.js b/web/grpc/identity-service-client-wrapper.js
--- a/web/grpc/identity-service-client-wrapper.js
+++ b/web/grpc/identity-service-client-wrapper.js
@@ -141,6 +141,13 @@
await this.authClient.logOutUser(new Empty());
};
+ logOutSecondaryDevice: () => Promise<void> = async () => {
+ if (!this.authClient) {
+ throw new Error('Identity service client is not initialized');
+ }
+ await this.authClient.logOutSecondaryDevice(new Empty());
+ };
+
getKeyserverKeys: (keyserverID: string) => Promise<DeviceOlmOutboundKeys> =
async (keyserverID: string) => {
const client = this.authClient;
diff --git a/web/grpc/identity-service-context-provider.react.js b/web/grpc/identity-service-context-provider.react.js
--- a/web/grpc/identity-service-context-provider.react.js
+++ b/web/grpc/identity-service-context-provider.react.js
@@ -120,6 +120,7 @@
deleteWalletUser: proxyMethodToWorker('deleteWalletUser'),
deletePasswordUser: proxyMethodToWorker('deletePasswordUser'),
logOut: proxyMethodToWorker('logOut'),
+ logOutSecondaryDevice: proxyMethodToWorker('logOutSecondaryDevice'),
getKeyserverKeys: proxyMethodToWorker('getKeyserverKeys'),
getOutboundKeysForUser: proxyMethodToWorker('getOutboundKeysForUser'),
getInboundKeysForUser: proxyMethodToWorker('getInboundKeysForUser'),

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 2:04 AM (5 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2559357
Default Alt Text
D12122.id40681.diff (2 KB)

Event Timeline