From ab0208943389859c4938e659243a4d0217a9212e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 11 Apr 2020 21:04:55 -0500 Subject: [PATCH] Redirect LoginPage after logging in --- .../features/auth_login/components/login_page.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/gabsocial/features/auth_login/components/login_page.js b/app/gabsocial/features/auth_login/components/login_page.js index da5758b7e..63724f733 100644 --- a/app/gabsocial/features/auth_login/components/login_page.js +++ b/app/gabsocial/features/auth_login/components/login_page.js @@ -1,11 +1,19 @@ import React from 'react'; import { connect } from 'react-redux' +import { Redirect } from 'react-router-dom'; import ImmutablePureComponent from 'react-immutable-pure-component'; import LoginForm from './login_form'; -export default @connect() +const mapStateToProps = state => ({ + me: state.get('me'), +}); + +export default @connect(mapStateToProps) class LoginPage extends ImmutablePureComponent { render() { + const { me } = this.props; + if (me) return ; + return } }