Support IS v2 auth in preview bar
parent
244b613623
commit
dacb5d42ac
|
@ -520,7 +520,12 @@ module.exports = React.createClass({
|
||||||
const isAccessToken = await authClient.getAccessToken();
|
const isAccessToken = await authClient.getAccessToken();
|
||||||
if (cancelled) return null;
|
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;
|
if (cancelled || lookup === null || !lookup.mxid) return null;
|
||||||
|
|
||||||
const profile = await MatrixClientPeg.get().getProfileInfo(lookup.mxid);
|
const profile = await MatrixClientPeg.get().getProfileInfo(lookup.mxid);
|
||||||
|
|
|
@ -25,6 +25,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
|
import IdentityAuthClient from '../../../IdentityAuthClient';
|
||||||
|
|
||||||
const MessageCase = Object.freeze({
|
const MessageCase = Object.freeze({
|
||||||
NotLoggedIn: "NotLoggedIn",
|
NotLoggedIn: "NotLoggedIn",
|
||||||
|
@ -111,8 +112,13 @@ module.exports = React.createClass({
|
||||||
if (this.props.inviterName && this.props.invitedEmail) {
|
if (this.props.inviterName && this.props.invitedEmail) {
|
||||||
this.setState({busy: true});
|
this.setState({busy: true});
|
||||||
try {
|
try {
|
||||||
|
const authClient = new IdentityAuthClient();
|
||||||
|
const isAccessToken = await authClient.getAccessToken();
|
||||||
const result = await MatrixClientPeg.get().lookupThreePid(
|
const result = await MatrixClientPeg.get().lookupThreePid(
|
||||||
'email', this.props.invitedEmail,
|
'email',
|
||||||
|
this.props.invitedEmail,
|
||||||
|
undefined /* callback */,
|
||||||
|
isAccessToken,
|
||||||
);
|
);
|
||||||
this.setState({invitedEmailMxid: result.mxid});
|
this.setState({invitedEmailMxid: result.mxid});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue