You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-26 04:01:04 +03:00
Pass a new prop 'startingQueryParams' to pluck out the email from the URL
This is preferable to doing the way other QPs are passed (secret, etc) because the link in the email wants to look like "#/room/<room_id_or_alias>" for guest read-access (only bouncing you to /login if that room is not readable by guests). This is hard to do in the current arch because we don't preserve QPs on /room paths, and we do conditional executions depending on if it is a room ID or alias. Rather than threading through the email in each section and creating a fragile mess, just pass the *starting* set of query parameters through to MatrixChat which can then do the Right Thing when the time comes.
This commit is contained in:
@ -41,7 +41,8 @@ module.exports = React.createClass({
|
||||
config: React.PropTypes.object.isRequired,
|
||||
ConferenceHandler: React.PropTypes.any,
|
||||
onNewScreen: React.PropTypes.func,
|
||||
registrationUrl: React.PropTypes.string
|
||||
registrationUrl: React.PropTypes.string,
|
||||
startingQueryParams: React.PropTypes.object
|
||||
},
|
||||
|
||||
PageTypes: {
|
||||
@ -75,6 +76,12 @@ module.exports = React.createClass({
|
||||
return s;
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
startingQueryParams: {}
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
if (this.state.logged_in) {
|
||||
@ -540,9 +547,9 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
notifyNewScreen: function(screen) {
|
||||
notifyNewScreen: function(screen, queryParamString) {
|
||||
if (this.props.onNewScreen) {
|
||||
this.props.onNewScreen(screen);
|
||||
this.props.onNewScreen(screen, queryParamString);
|
||||
}
|
||||
},
|
||||
|
||||
@ -706,6 +713,7 @@ module.exports = React.createClass({
|
||||
clientSecret={this.state.register_client_secret}
|
||||
sessionId={this.state.register_session_id}
|
||||
idSid={this.state.register_id_sid}
|
||||
email={this.props.startingQueryParams.email}
|
||||
hsUrl={this.props.config.default_hs_url}
|
||||
isUrl={this.props.config.default_is_url}
|
||||
registrationUrl={this.props.registrationUrl}
|
||||
|
Reference in New Issue
Block a user