mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
37 lines
792 B
JavaScript
37 lines
792 B
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
import Router from 'react-router';
|
|
|
|
import UserActions from '../actions/user_actions';
|
|
import Alt from '../alt';
|
|
|
|
import AppConstants from '../constants/application_constants';
|
|
let baseUrl = AppConstants.baseUrl;
|
|
|
|
let LogoutContainer = React.createClass({
|
|
|
|
mixins: [Router.Navigation, Router.State],
|
|
|
|
componentDidMount() {
|
|
UserActions.logoutCurrentUser()
|
|
.then(() => {
|
|
Alt.flush();
|
|
// kill intercom (with fire)
|
|
window.Intercom('shutdown');
|
|
this.transitionTo(baseUrl);
|
|
})
|
|
.catch((err) => {
|
|
console.logGlobal(err);
|
|
});
|
|
},
|
|
|
|
render() {
|
|
return null;
|
|
}
|
|
|
|
});
|
|
|
|
|
|
export default LogoutContainer;
|