mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Support IS v2 auth in preview bar
This commit is contained in:
parent
244b613623
commit
dacb5d42ac
2 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue