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');
|
2015-09-28 17:21:34 +02:00
|
|
|
this.replaceWith(baseUrl);
|
2015-07-17 18:53:04 +02:00
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.logGlobal(err);
|
|
|
|
});
|
2015-07-17 15:02:44 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default LogoutContainer;
|