1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 18:13:49 +01:00
onion/js/components/logout_container.js

37 lines
792 B
JavaScript
Raw Normal View History

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;