From e7097d58ecae06d2e9370c03b2654425e01bad47 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 22 Aug 2019 14:44:09 +0100 Subject: [PATCH 1/2] Add IS access token callback This passes a callback to the JS SDK which it can use to get IS access tokens whenever needed for either talking to the IS directly or passing along to the HS. Fixes https://github.com/vector-im/riot-web/issues/10525 --- src/MatrixClientPeg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 813f0ed87e4..94bf6e30d90 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -32,6 +32,7 @@ import Modal from './Modal'; import {verificationMethods} from 'matrix-js-sdk/lib/crypto'; import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler"; import * as StorageManager from './utils/StorageManager'; +import IdentityAuthClient from './IdentityAuthClient'; interface MatrixClientCreds { homeserverUrl: string, @@ -219,6 +220,9 @@ class MatrixClientPeg { fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'), verificationMethods: [verificationMethods.SAS], unstableClientRelationAggregation: true, + getIdentityAccessToken: () => { + return new IdentityAuthClient().getAccessToken(); + }, }; this.matrixClient = createMatrixClient(opts); From 84e3d339ac0a67035c0b0330f7470bbec136c52a Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 23 Aug 2019 11:17:51 +0100 Subject: [PATCH 2/2] Change to provider object --- src/MatrixClientPeg.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 94bf6e30d90..27c4f406692 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -220,9 +220,7 @@ class MatrixClientPeg { fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'), verificationMethods: [verificationMethods.SAS], unstableClientRelationAggregation: true, - getIdentityAccessToken: () => { - return new IdentityAuthClient().getAccessToken(); - }, + identityServer: new IdentityAuthClient(), }; this.matrixClient = createMatrixClient(opts);