1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 09:50:31 +01:00
onion/js/components/logout_container.js
2015-10-07 09:31:38 +02:00

40 lines
945 B
JavaScript

'use strict';
import React from 'react';
import Router from 'react-router';
import UserActions from '../actions/user_actions';
import { alt, altWhitelabel, altUser, altThirdParty } 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();
altWhitelabel.flush();
altUser.flush();
altThirdParty.flush();
// kill intercom (with fire)
window.Intercom('shutdown');
this.replaceWith(baseUrl);
})
.catch((err) => {
console.logGlobal(err);
});
},
render() {
return null;
}
});
export default LogoutContainer;