Send also domain and user localpart to HostingSignupDialog iframe

This commit is contained in:
Jason Robinson 2020-11-18 17:53:27 +02:00
parent b3b3f5ebeb
commit d607999cff

View file

@ -47,10 +47,10 @@ export default class HostingSignupDialog extends React.PureComponent<IProps, ISt
if (!this.hostingSignupUrl.startsWith(message.origin)) {
return;
}
switch (message.data.action) {
case 'access_token_credential_request':
this.sendAccessToken();
case 'account_credentials_request':
// noinspection JSIgnoredPromiseFromCall
this.sendAccountDetails();
break;
case 'openid_credentials_request':
// noinspection JSIgnoredPromiseFromCall
@ -103,10 +103,14 @@ export default class HostingSignupDialog extends React.PureComponent<IProps, ISt
}
}
private sendAccessToken() {
private async sendAccountDetails() {
this.sendMessage({
action: 'access_token_credential',
token: MatrixClientPeg.get().getAccessToken(),
action: 'account_credentials',
credentials: {
accessToken: await MatrixClientPeg.get().getAccessToken(),
serverName: await MatrixClientPeg.get().getDomain(),
userLocalpart: await MatrixClientPeg.get().getUserIdLocalpart(),
},
});
}