2015-07-17 15:02:44 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import Router from 'react-router';
|
|
|
|
|
|
|
|
import UserActions from '../actions/user_actions';
|
|
|
|
import Alt from '../alt';
|
|
|
|
|
2015-07-17 18:01:22 +02:00
|
|
|
import AppConstants from '../constants/application_constants';
|
|
|
|
let baseUrl = AppConstants.baseUrl;
|
2015-07-17 15:02:44 +02:00
|
|
|
|
|
|
|
let LogoutContainer = React.createClass({
|
|
|
|
|
|
|
|
mixins: [Router.Navigation, Router.State],
|
|
|
|
|
|
|
|
componentDidMount() {
|
2015-07-17 18:53:04 +02:00
|
|
|
UserActions.logoutCurrentUser()
|
|
|
|
.then(() => {
|
|
|
|
Alt.flush();
|
|
|
|
// kill intercom (with fire)
|
|
|
|
window.Intercom('shutdown');
|
|
|
|
this.transitionTo(baseUrl);
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.logGlobal(err);
|
|
|
|
});
|
2015-07-17 15:02:44 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default LogoutContainer;
|