1
0
Fork 0
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:
Sonja Happ 2020-03-20 11:46:43 +01:00
parent 3e6ccd07d1
commit 58809e3e41
2 changed files with 1 additions and 2 deletions

View file

@ -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"));

View file

@ -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({