Support IS v2 auth in preview bar

This commit is contained in:
J. Ryan Stinnett 2019-07-29 15:08:54 +01:00
parent 244b613623
commit dacb5d42ac
2 changed files with 13 additions and 2 deletions

View file

@ -520,7 +520,12 @@ module.exports = React.createClass({
const isAccessToken = await authClient.getAccessToken();
if (cancelled) return null;
const lookup = await MatrixClientPeg.get().lookupThreePid(medium, address, undefined, isAccessToken);
const lookup = await MatrixClientPeg.get().lookupThreePid(
medium,
address,
undefined /* callback */,
isAccessToken,
);
if (cancelled || lookup === null || !lookup.mxid) return null;
const profile = await MatrixClientPeg.get().getProfileInfo(lookup.mxid);

View file

@ -25,6 +25,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
import dis from '../../../dispatcher';
import classNames from 'classnames';
import { _t } from '../../../languageHandler';
import IdentityAuthClient from '../../../IdentityAuthClient';
const MessageCase = Object.freeze({
NotLoggedIn: "NotLoggedIn",
@ -111,8 +112,13 @@ module.exports = React.createClass({
if (this.props.inviterName && this.props.invitedEmail) {
this.setState({busy: true});
try {
const authClient = new IdentityAuthClient();
const isAccessToken = await authClient.getAccessToken();
const result = await MatrixClientPeg.get().lookupThreePid(
'email', this.props.invitedEmail,
'email',
this.props.invitedEmail,
undefined /* callback */,
isAccessToken,
);
this.setState({invitedEmailMxid: result.mxid});
} catch (err) {