Redirect LoginPage after logging in
This commit is contained in:
parent
d7ca4d3be1
commit
ab02089433
1 changed files with 9 additions and 1 deletions
|
@ -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 <Redirect to='/' />;
|
||||
|
||||
return <LoginForm />
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue