From d7cdcf082fab6c0cb7c2fe4bed821bd1a8000e69 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Mon, 8 Feb 2016 07:26:10 -0500
Subject: Convering client to react-router.

---
 web/react/components/login_email.jsx | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

(limited to 'web/react/components/login_email.jsx')

diff --git a/web/react/components/login_email.jsx b/web/react/components/login_email.jsx
index cf1e1bc40..3e0d8919d 100644
--- a/web/react/components/login_email.jsx
+++ b/web/react/components/login_email.jsx
@@ -4,6 +4,7 @@
 import * as Utils from '../utils/utils.jsx';
 import * as Client from '../utils/client.jsx';
 import UserStore from '../stores/user_store.jsx';
+import {browserHistory} from 'react-router';
 
 import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl';
 
@@ -72,13 +73,7 @@ class LoginEmail extends React.Component {
         Client.loginByEmail(name, email, password,
             () => {
                 UserStore.setLastEmail(email);
-
-                const redirect = Utils.getUrlParameter('redirect');
-                if (redirect) {
-                    window.location.href = decodeURIComponent(redirect);
-                } else {
-                    window.location.href = '/' + name + '/channels/town-square';
-                }
+                browserHistory.push('/' + name + '/channels/town-square');
             },
             (err) => {
                 if (err.id === 'api.user.login.not_verified.app_error') {
@@ -167,4 +162,4 @@ LoginEmail.propTypes = {
     teamName: React.PropTypes.string.isRequired
 };
 
-export default injectIntl(LoginEmail);
\ No newline at end of file
+export default injectIntl(LoginEmail);
-- 
cgit v1.2.3-1-g7c22

