mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
check for existing current user upon app mount
This commit is contained in:
parent
e44c7da7e3
commit
82874b2222
1 changed files with 2 additions and 1 deletions
|
@ -66,10 +66,11 @@ class App extends React.Component {
|
|||
componentDidMount() {
|
||||
NotificationsDataManager.setSystem(this.refs.notificationSystem);
|
||||
|
||||
|
||||
// if token stored locally, request user
|
||||
let token = localStorage.getItem("token");
|
||||
let currentUser = JSON.parse(localStorage.getItem("currentUser"));
|
||||
if (token != null && token !== '') {
|
||||
if (token != null && token !== '' && currentUser != null) {
|
||||
AppDispatcher.dispatch({
|
||||
type: 'users/logged-in',
|
||||
token: token,
|
||||
|
|
Loading…
Add table
Reference in a new issue