diff --git a/src/components/navigation/navigation.jsx b/src/components/navigation/navigation.jsx index 7286e6cbb..c27547840 100644 --- a/src/components/navigation/navigation.jsx +++ b/src/components/navigation/navigation.jsx @@ -4,7 +4,6 @@ var ReactIntl = require('react-intl'); var defineMessages = ReactIntl.defineMessages; var FormattedMessage = ReactIntl.FormattedMessage; var injectIntl = ReactIntl.injectIntl; -var xhr = require('xhr'); var Api = require('../../mixins/api.jsx'); var Avatar = require('../avatar/avatar.jsx'); @@ -151,16 +150,14 @@ var Navigation = React.createClass({ }, handleLogOut: function (e) { e.preventDefault(); - xhr({ + this.api({ host: '', - uri: '/accounts/logout/' - }, function (err) { - if (err) { - log.error(err); - } else { - this.closeLogin(); - window.refreshSession(); - } + method: 'post', + uri: '/accounts/logout/', + useCsrf: true + }, function (err, body) { + if (err) return; + if (body) log.warn('body found on logout'); // shouldn't happen }.bind(this)); }, handleAccountNavClick: function (e) {