mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
add JSON.parse around current user from local storage in login
This commit is contained in:
parent
3e6ccd07d1
commit
58809e3e41
2 changed files with 1 additions and 2 deletions
|
@ -66,7 +66,6 @@ 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"));
|
||||
|
|
|
@ -55,7 +55,7 @@ class Login extends Component {
|
|||
// if token stored locally, request user
|
||||
if (this.state.token == null) {
|
||||
const token = localStorage.getItem('token');
|
||||
const currentUser = localStorage.getItem('currentUser');
|
||||
const currentUser = JSON.parse(localStorage.getItem('currentUser'));
|
||||
|
||||
if (token != null && token !== '' && currentUser != null && this.state.currentUser == null) {
|
||||
AppDispatcher.dispatch({
|
||||
|
|
Loading…
Add table
Reference in a new issue