From a7c53e99d9675f6cbceba5ea206c769235c50410 Mon Sep 17 00:00:00 2001 From: Steven Hammerton Date: Fri, 6 Nov 2015 11:42:13 +0000 Subject: [PATCH] Clear query params from url with a nasty location update --- src/controllers/pages/MatrixChat.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index 796a3e858e..e258866317 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -23,6 +23,8 @@ var sdk = require('../../index'); var MatrixTools = require('../../MatrixTools'); var linkifyMatrix = require("../../linkify-matrix"); +var url = require('url'); + module.exports = { PageTypes: { RoomView: "room_view", @@ -157,8 +159,13 @@ module.exports = { screen: undefined, logged_in: true }); - self.startMatrixClient(); - self.notifyNewScreen(''); + + // We're left with the login token, hs and is url as query params + // in the url, a little nasty but let's redirect to clear them + var parsedUrl = url.parse(window.location.href); + parsedUrl.search = ""; + window.location.href = url.format(parsedUrl); + }, function(error) { self.notifyNewScreen('login'); self.setState({errorText: 'Login failed.'});