From 42a90f49c28a7a2fc530d7d9a7aec43ab190a46f Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 7 Mar 2016 17:11:01 +0000 Subject: [PATCH] Use the guest access tokens sent in 3pid invite emails. --- src/components/structures/MatrixChat.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index c189c6be10..e50669c26a 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -99,6 +99,18 @@ module.exports = React.createClass({ console.log("Not registering as guest; registration."); this._autoRegisterAsGuest = false; } + else if (this.props.startingQueryParams.guest_user_id && + this.props.startingQueryParams.guest_access_token) + { + this._autoRegisterAsGuest = false; + this.onLoggedIn({ + userId: this.props.startingQueryParams.guest_user_id, + accessToken: this.props.startingQueryParams.guest_access_token, + homeserverUrl: this.props.config.default_hs_url, + identityServerUrl: this.props.config.default_is_url, + guest: true + }); + } else { this._autoRegisterAsGuest = true; }