mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Fix logout
This commit is contained in:
parent
0e655f2613
commit
5d5096a695
3 changed files with 4 additions and 4 deletions
|
@ -97,9 +97,9 @@ class App extends Component {
|
|||
componentWillUpdate(nextProps, nextState) {
|
||||
// check if user is still logged in
|
||||
if (UserStore.getState().token == null) {
|
||||
this.props.router.push('/login');
|
||||
//this.props.router.push('/login');
|
||||
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
// open connection to each required simulator
|
||||
|
|
|
@ -37,7 +37,7 @@ class Home extends Component {
|
|||
localStorage.setItem('token', '');
|
||||
|
||||
// transition to login page
|
||||
this.props.router.push('/login');
|
||||
nextProps.router.push('/login');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class UserStore extends ReduceStore {
|
|||
|
||||
case 'users/logout':
|
||||
// delete user and token
|
||||
return { token: null, currentUser: null };
|
||||
return Object.assign({}, state, { token: null, currentUser: null });
|
||||
|
||||
case 'users/logged-in':
|
||||
// request logged-in user data
|
||||
|
|
Loading…
Add table
Reference in a new issue