Upstream sync

This commit is contained in:
Senad Uka
2018-05-28 15:28:19 +02:00
parent 372b3883a0
commit 3969863cbf
10 changed files with 175 additions and 60 deletions

View File

@@ -8,6 +8,10 @@ import Dialog from 'material-ui/Dialog';
import Instance from '../../../components/Connection';
import {
loggedUser
} from 'utils/authorization';
class Login extends React.Component {
constructor(props) {
super(props);
@@ -75,9 +79,10 @@ class Login extends React.Component {
let auth = res.data;
state.setCookie('token', auth.token, auth.valid_time);
localStorage.setItem('loggedUser', JSON.stringify(auth.user));
Instance.setToken(auth.token);
loggedUser.update();
location.href = '/#/';
}).catch(function (err) {
state.setState(Object.assign(state.state, {