You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Redirect to the registration page when landing with ?email=
Fixes "Missing access token" error.
This commit is contained in:
@ -96,6 +96,10 @@ module.exports = React.createClass({
|
|||||||
if (!this.props.config || !this.props.config.default_hs_url) {
|
if (!this.props.config || !this.props.config.default_hs_url) {
|
||||||
console.error("Cannot enable guest access: No supplied config prop for HS/IS URLs");
|
console.error("Cannot enable guest access: No supplied config prop for HS/IS URLs");
|
||||||
}
|
}
|
||||||
|
else if (this.props.startingQueryParams.email) {
|
||||||
|
console.log("Not registering as guest; email invite.");
|
||||||
|
this._autoRegisterAsGuest = false;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this._autoRegisterAsGuest = true;
|
this._autoRegisterAsGuest = true;
|
||||||
}
|
}
|
||||||
@ -634,6 +638,14 @@ module.exports = React.createClass({
|
|||||||
action: 'start_post_registration',
|
action: 'start_post_registration',
|
||||||
});
|
});
|
||||||
} else if (screen.indexOf('room/') == 0) {
|
} else if (screen.indexOf('room/') == 0) {
|
||||||
|
|
||||||
|
if (!this.state.logged_in && this.props.startingQueryParams.email) {
|
||||||
|
console.log("Redirecting to email registration");
|
||||||
|
this.showScreen("register");
|
||||||
|
this.notifyNewScreen('register'); // this doesn't call showScreen, just updates the hash
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var roomString = screen.split('/')[1];
|
var roomString = screen.split('/')[1];
|
||||||
if (roomString[0] == '#') {
|
if (roomString[0] == '#') {
|
||||||
if (this.state.logged_in) {
|
if (this.state.logged_in) {
|
||||||
@ -655,7 +667,7 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (screen) console.error("Unknown screen : %s", screen);
|
console.error("Unknown screen : %s", screen);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -802,7 +814,6 @@ module.exports = React.createClass({
|
|||||||
var RoomDirectory = sdk.getComponent('structures.RoomDirectory');
|
var RoomDirectory = sdk.getComponent('structures.RoomDirectory');
|
||||||
var MatrixToolbar = sdk.getComponent('globals.MatrixToolbar');
|
var MatrixToolbar = sdk.getComponent('globals.MatrixToolbar');
|
||||||
var ForgotPassword = sdk.getComponent('structures.login.ForgotPassword');
|
var ForgotPassword = sdk.getComponent('structures.login.ForgotPassword');
|
||||||
|
|
||||||
// needs to be before normal PageTypes as you are logged in technically
|
// needs to be before normal PageTypes as you are logged in technically
|
||||||
if (this.state.screen == 'post_registration') {
|
if (this.state.screen == 'post_registration') {
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user