Added redirect on login
This commit is contained in:
@@ -136,7 +136,7 @@ class Home extends React.Component {
|
||||
return (
|
||||
<div className='sidePanel'>
|
||||
<SignupPanel />
|
||||
<Login />
|
||||
<Login onSubmit={() => {this.props.history.push('/profile');}} />
|
||||
<RecoverPanel />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -60,6 +60,10 @@ class Login extends React.Component {
|
||||
if (xhr.status === 200) {
|
||||
let json = JSON.parse(xhr.responseText);
|
||||
this.props.login(json.id, json.email, json.username, json.token);
|
||||
|
||||
if (this.props.onSubmit) {
|
||||
this.props.onSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
else if (xhr.status === 400) {
|
||||
|
||||
Reference in New Issue
Block a user