1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

patch logout behavior

This commit is contained in:
Tim Daubenschütz 2015-07-17 18:53:04 +02:00
parent 28f875e90c
commit efd329c44c
3 changed files with 11 additions and 8 deletions

View File

@ -23,7 +23,7 @@ class UserActions {
});
}
logoutCurrentUser() {
UserFetcher.logout()
return UserFetcher.logout()
.then(() => {
this.actions.deleteCurrentUser();
})

View File

@ -80,7 +80,6 @@ let Form = React.createClass({
this.setState({edited: false, submitted: false});
},
handleError(err){
console.log(err);
if (err.json) {
for (var input in err.json.errors){
if (this.refs && this.refs[input] && this.refs[input].state) {

View File

@ -3,7 +3,6 @@
import React from 'react';
import Router from 'react-router';
let Link = Router.Link;
import UserActions from '../actions/user_actions';
import Alt from '../alt';
@ -15,11 +14,16 @@ let LogoutContainer = React.createClass({
mixins: [Router.Navigation, Router.State],
componentDidMount() {
UserActions.logoutCurrentUser();
Alt.flush();
// kill intercom (with fire)
window.Intercom('shutdown');
this.transitionTo(baseUrl);
UserActions.logoutCurrentUser()
.then(() => {
Alt.flush();
// kill intercom (with fire)
window.Intercom('shutdown');
this.transitionTo(baseUrl);
})
.catch((err) => {
console.logGlobal(err);
});
},
render() {