From b62e29ba9cd6183551266da05b9b602a4415d738 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 24 Mar 2016 11:05:13 -0400 Subject: Moving all links and redirects to react-router --- webapp/components/login.jsx | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'webapp/components/login.jsx') diff --git a/webapp/components/login.jsx b/webapp/components/login.jsx index a60303d11..ad30f0619 100644 --- a/webapp/components/login.jsx +++ b/webapp/components/login.jsx @@ -11,7 +11,7 @@ import Constants from 'utils/constants.jsx'; import TeamStore from 'stores/team_store.jsx'; import {FormattedMessage} from 'react-intl'; -import {browserHistory} from 'react-router'; +import {browserHistory, Link} from 'react-router'; import React from 'react'; @@ -57,10 +57,10 @@ export default class Login extends React.Component { let loginMessage = []; if (global.window.mm_config.EnableSignUpWithGitLab === 'true') { loginMessage.push( - @@ -69,16 +69,16 @@ export default class Login extends React.Component { defaultMessage='with GitLab' /> - + ); } if (global.window.mm_config.EnableSignUpWithGoogle === 'true') { loginMessage.push( - @@ -87,7 +87,7 @@ export default class Login extends React.Component { defaultMessage='with Google Apps' /> - + ); } @@ -154,12 +154,12 @@ export default class Login extends React.Component { if (emailSignup) { forgotPassword = (
- + - +
); } @@ -173,15 +173,15 @@ export default class Login extends React.Component { id='login.noAccount' defaultMessage="Don't have an account? " /> - - + ); @@ -191,15 +191,15 @@ export default class Login extends React.Component { if (global.window.mm_config.EnableTeamCreation === 'true' && !Utils.isMobileApp()) { teamSignUp = (
- - +
); } @@ -257,12 +257,12 @@ export default class Login extends React.Component { return (
- + - +
-- cgit v1.2.3-1-g7c22 From d6a6668a39db2f78d59919686c5d7b901888da36 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 24 Mar 2016 11:27:05 -0400 Subject: Modifying login not to display until it has finished checking. Caused admin console to redirect to town-square. Will be changed after user model flip. --- webapp/components/login.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'webapp/components/login.jsx') diff --git a/webapp/components/login.jsx b/webapp/components/login.jsx index ad30f0619..e8180895d 100644 --- a/webapp/components/login.jsx +++ b/webapp/components/login.jsx @@ -29,6 +29,8 @@ export default class Login extends React.Component { Client.getMeLoggedIn((data) => { if (data && data.logged_in !== 'false') { browserHistory.push('/' + this.props.params.team + '/channels/town-square'); + } else { + this.setState({doneCheckLogin: true}); //eslint-disable-line react/no-did-mount-set-state } }); } @@ -37,7 +39,8 @@ export default class Login extends React.Component { } getStateFromStores() { return { - currentTeam: TeamStore.getByName(this.props.params.team) + currentTeam: TeamStore.getByName(this.props.params.team), + doneCheckLogin: false }; } onTeamChange() { @@ -45,7 +48,7 @@ export default class Login extends React.Component { } render() { const currentTeam = this.state.currentTeam; - if (currentTeam == null) { + if (currentTeam == null || !this.state.doneCheckLogin) { return
; } -- cgit v1.2.3-1-g7c22