mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 20:36:57 +03:00
Merge branch 'new-guest-access' of github.com:matrix-org/matrix-react-sdk into new-guest-access
This commit is contained in:
commit
0707b7440a
2 changed files with 8 additions and 39 deletions
|
@ -232,9 +232,15 @@ export default React.createClass({
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PageTypes.HomePage:
|
case PageTypes.HomePage:
|
||||||
|
// If team server config is present, pass the teamServerURL. props.teamToken
|
||||||
|
// must also be set for the team page to be displayed, otherwise the
|
||||||
|
// welcomePageUrl is used (which might be undefined).
|
||||||
|
const teamServerUrl = this.props.config.teamServerConfig ?
|
||||||
|
this.props.config.teamServerConfig.teamServerURL : null;
|
||||||
|
|
||||||
page_element = <HomePage
|
page_element = <HomePage
|
||||||
collapsedRhs={this.props.collapse_rhs}
|
collapsedRhs={this.props.collapse_rhs}
|
||||||
teamServerUrl={this.props.config.teamServerConfig.teamServerURL}
|
teamServerUrl={teamServerUrl}
|
||||||
teamToken={this.props.teamToken}
|
teamToken={this.props.teamToken}
|
||||||
homePageUrl={this.props.config.welcomePageUrl}
|
homePageUrl={this.props.config.welcomePageUrl}
|
||||||
/>;
|
/>;
|
||||||
|
|
|
@ -53,9 +53,6 @@ export default React.createClass({
|
||||||
doingUIAuth: false,
|
doingUIAuth: false,
|
||||||
// Indicate error with auth
|
// Indicate error with auth
|
||||||
authError: '',
|
authError: '',
|
||||||
|
|
||||||
// Indicate success of setting mxid
|
|
||||||
success: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -98,10 +95,6 @@ export default React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onSuccessContinue: function() {
|
|
||||||
this.props.onFinished(true, this._registeredCreds);
|
|
||||||
},
|
|
||||||
|
|
||||||
_doUsernameCheck: function() {
|
_doUsernameCheck: function() {
|
||||||
// Check if username is available
|
// Check if username is available
|
||||||
return this._matrixClient.isUsernameAvailable(this.state.username).then(
|
return this._matrixClient.isUsernameAvailable(this.state.username).then(
|
||||||
|
@ -169,7 +162,7 @@ export default React.createClass({
|
||||||
// XXX Implement RTS /register here
|
// XXX Implement RTS /register here
|
||||||
const teamToken = null;
|
const teamToken = null;
|
||||||
|
|
||||||
this._registeredCreds = {
|
this.props.onFinished(true, {
|
||||||
userId: response.user_id,
|
userId: response.user_id,
|
||||||
deviceId: response.device_id,
|
deviceId: response.device_id,
|
||||||
homeserverUrl: this._matrixClient.getHomeserverUrl(),
|
homeserverUrl: this._matrixClient.getHomeserverUrl(),
|
||||||
|
@ -177,11 +170,6 @@ export default React.createClass({
|
||||||
accessToken: response.access_token,
|
accessToken: response.access_token,
|
||||||
password: this._generatedPassword,
|
password: this._generatedPassword,
|
||||||
teamToken: teamToken,
|
teamToken: teamToken,
|
||||||
};
|
|
||||||
|
|
||||||
// Before continuing, show a warm-fuzzy success and only submit onSuccessContinue
|
|
||||||
this.setState({
|
|
||||||
success: true,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -231,31 +219,6 @@ export default React.createClass({
|
||||||
!this.state.usernameError &&
|
!this.state.usernameError &&
|
||||||
!this.state.usernameBusy;
|
!this.state.usernameBusy;
|
||||||
|
|
||||||
if (this.state.success) {
|
|
||||||
// XXX BaseDialog needs an onFinished
|
|
||||||
return (
|
|
||||||
<BaseDialog className="mx_SetMxIdDialog"
|
|
||||||
title="You have successfully picked a username!"
|
|
||||||
>
|
|
||||||
<div className="mx_Dialog_content">
|
|
||||||
<p>
|
|
||||||
You have successfully
|
|
||||||
picked <b>{ this.state.username }</b> as your
|
|
||||||
username and you now have access to the full
|
|
||||||
set of features on Riot.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="mx_Dialog_buttons">
|
|
||||||
<input className="mx_Dialog_primary"
|
|
||||||
type="submit"
|
|
||||||
value="Continue"
|
|
||||||
onClick={this.onSuccessContinue}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</BaseDialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseDialog className="mx_SetMxIdDialog"
|
<BaseDialog className="mx_SetMxIdDialog"
|
||||||
onFinished={this.props.onFinished}
|
onFinished={this.props.onFinished}
|
||||||
|
|
Loading…
Reference in a new issue