Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add IS access token callback
Browse files Browse the repository at this point in the history
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 element-hq/element-web#10525
  • Loading branch information
jryans committed Aug 22, 2019
1 parent f5da870 commit e7097d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MatrixClientPeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -219,6 +220,9 @@ class MatrixClientPeg {
fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'),
verificationMethods: [verificationMethods.SAS],
unstableClientRelationAggregation: true,
getIdentityAccessToken: () => {
return new IdentityAuthClient().getAccessToken();
},
};

this.matrixClient = createMatrixClient(opts);
Expand Down

0 comments on commit e7097d5

Please sign in to comment.